2017-09-07 21:38:38 +03:00
|
|
|
#!/bin/bash
|
|
|
|
set -e
|
|
|
|
|
2017-09-07 21:58:55 +03:00
|
|
|
function generate() {
|
|
|
|
pushd modules > /dev/null
|
2017-10-10 09:09:04 +03:00
|
|
|
../node_modules/.bin/yo ../tools/generator-primer-module/app "$@"
|
2017-09-07 21:58:55 +03:00
|
|
|
popd > /dev/null
|
|
|
|
}
|
2017-09-07 21:38:38 +03:00
|
|
|
|
2017-09-07 21:58:55 +03:00
|
|
|
if [[ "$@" == "--help" ]]; then
|
|
|
|
generate "$@"
|
|
|
|
else
|
|
|
|
echo
|
|
|
|
echo "📦 Creating a new module..."
|
|
|
|
echo
|
|
|
|
echo " Protip: you can pass --force to skip the Yeoman conflict prompts."
|
|
|
|
echo " Otherwise, press 'y' for each one or 'a' for the first."
|
|
|
|
echo
|
2017-09-07 21:38:38 +03:00
|
|
|
|
2017-09-07 21:58:55 +03:00
|
|
|
generate "$@"
|
|
|
|
|
|
|
|
echo "✅ All set! Let me bootstrap that new module for ya..."
|
|
|
|
npm run bootstrap
|
|
|
|
fi
|