Skip to content

Instantly share code, notes, and snippets.

@DavidWells
Created April 24, 2020 04:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save DavidWells/87df8efda2dc4efa6323593ae2fe610f to your computer and use it in GitHub Desktop.
Save DavidWells/87df8efda2dc4efa6323593ae2fe610f to your computer and use it in GitHub Desktop.
Automatically install deps for any serverless project found
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