Skip to content

Instantly share code, notes, and snippets.

@luceos
Created June 7, 2018 14:51
Show Gist options
  • Save luceos/ddc5dc2b43edec7637300db3b29041f0 to your computer and use it in GitHub Desktop.
Save luceos/ddc5dc2b43edec7637300db3b29041f0 to your computer and use it in GitHub Desktop.
recompile all extensions of flarum
#!/usr/bin/env bash
base=$PWD
for PACKAGE in `find vendor -mindepth 2 -maxdepth 2 -type d`
do
cd $PACKAGE
PACKAGE_PATH=$PWD
if [ -f "bootstrap.php" ]; then
echo "> --- Found extension $PACKAGE";
if [ -d "js" ]; then
if [ -f "js/bower.json" ]; then
cd js/
bower install
cd $PACKAGE_PATH
fi
for JS in `find js -mindepth 1 -maxdepth 1 -type d`
do
cd $JS
if [ -f "bower.json" ]; then
bower install
fi
if [ -f "package.json" ]; then
npm install
fi
if [ -f "Gulpfile.js" ]; then
node_modules/gulp/bin/gulp.js
fi
if [ -d "node_modules" ]; then
rm -rf node_modules
fi
cd $PACKAGE_PATH
done
fi
fi
cd $base
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment