Skip to content

Instantly share code, notes, and snippets.

@yatishbalaji
Last active March 23, 2020 07:51
Show Gist options
  • Select an option

  • Save yatishbalaji/255ba1a3c0f8135e04f630c8b2518625 to your computer and use it in GitHub Desktop.

Select an option

Save yatishbalaji/255ba1a3c0f8135e04f630c8b2518625 to your computer and use it in GitHub Desktop.
loop over all projects in directory and run npm i
for f in ~/yatish/projects/*;
do
if [ -d $f ]; then
echo Entering into $f && cd "$f";
if [ ! -d "node_modules" ]; then
[ -f "package.json" ] && echo "Installing" && npm i;
fi
if [ -d "lambda" ]; then
echo "Entering lambda" && cd lambda && [ ! -d "node_modules" ] && [ -f "package.json" ] && echo "Installing lambda" && npm i;
fi
fi
done;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment