Uh oh!
There was an error while loading. Please reload this page.
This repository was archived by the owner on Jan 7, 2019. It is now read-only.
- Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathindex.js
More file actions
Latest commit
44 lines (39 loc) · 1.41 KB
/
Copy pathindex.js
File metadata and controls
44 lines (39 loc) · 1.41 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
/* eslint-env node */
'use strict';
constpath=require('path');
constRuntimeBin=require('lambda-bin');
consttargetPath=path.resolve(__dirname,path.join('bin','git'));
constminPack=require('./git.json');
exports.prepareGit=(options)=>{
options=options||{};
vartargetDirectory=options.targetDirectory||'/tmp/git';
varupdateEnv=(options.updateEnv!==undefined) ? options.updateEnv : true;
varGIT_TEMPLATE_DIR=path.join(targetDirectory,'usr/share/git-core/templates');
varGIT_EXEC_PATH=path.join(targetDirectory,'usr/libexec/git-core');
varLD_LIBRARY_PATH=path.join(targetDirectory,'usr/lib64');
varbinPath=path.join(targetDirectory,'usr/bin');
varlambdaBinRuntime=newRuntimeBin({
useSymlinks: true,
targetPath,
minPack,
});
returnlambdaBinRuntime.applyMinPack(targetDirectory).then(()=>{
if(updateEnv){
process.env.PATH=process.env.PATH+':'+binPath;
process.env.GIT_TEMPLATE_DIR=GIT_TEMPLATE_DIR;
process.env.GIT_EXEC_PATH=GIT_EXEC_PATH;
process.env.LD_LIBRARY_PATH=process.env.LD_LIBRARY_PATH
? process.env.LD_LIBRARY_PATH+':'+LD_LIBRARY_PATH
: LD_LIBRARY_PATH;
}else{
return{
binPath: binPath,
env: {
GIT_TEMPLATE_DIR: GIT_TEMPLATE_DIR,
GIT_EXEC_PATH: GIT_EXEC_PATH,
LD_LIBRARY_PATH: LD_LIBRARY_PATH
}
};
}
});
};