Created
April 24, 2020 04:30
-
-
Save DavidWells/87df8efda2dc4efa6323593ae2fe610f to your computer and use it in GitHub Desktop.
Automatically install deps for any serverless project found
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const path = require('path') | |
const globby = require('globby') | |
const execSync = require('child_process').execSync | |
globby(['*/serverless.yml']).then(paths => { | |
// Now run npm install | |
const command = `npm install` | |
paths.forEach((p) => { | |
var t = path.join(__dirname, p) | |
execSync(command, { | |
cwd: path.dirname(t), | |
stdio: [0, 1, 2] | |
}) | |
}) | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment