lambda-git
@lambda-git
A git binary installed through NPM, for use with AWS Lambda.
Deprecated: this module isn't supported on AWS Linux 2 - you probably want to use git-lambda-layer instead. See https://github.com/pimterry/lambda-git/issues/14 for further context.
To use this, just require it, and call it.
;
This call returns a Promise, and once it completes your Node process will be set up to run Git as a subprocess. lambda-git
extracts a Lambda-built version of Git, updates the required environment variables to make it functional, and updates your process.env.PATH to make it accessible.
A larger example:
const exec = ; ;
If you want to do something more complicated, you can provide options to change this behaviour.
The Git binary itself comes from LambCI.
Changing the installation path:
targetDirectory: "/tmp/alternate/path/git";
Managing env vars yourself:
updateEnv: false;/* Returns:{ binPath: "/tmp/git/usr/bin", env: { GIT_TEMPLATE_DIR: '/tmp/git/usr/share/git-core/templates', GIT_EXEC_PATH: '/tmp/git/usr/libexec/git-core' }} */
You'll need to extract these values and ensure they're made available to whatever process you're using to run Git.