Skip to content

Instantly share code, notes, and snippets.

@monry
Forked from mattak/umm-create.sh
Created July 25, 2018 03:31
Show Gist options
  • Save monry/f31a1f1bc486c11bcf1913a477542cf0 to your computer and use it in GitHub Desktop.
Save monry/f31a1f1bc486c11bcf1913a477542cf0 to your computer and use it in GitHub Desktop.
Create empty umm project
#!/bin/sh
set -ue
if [ ! -e $HOME/.umm-config.json ]; then
cat <<__CHECK__
ERROR: Cannot find umm-config.json
Make sure the file exists on $HOME/.umm-config.json
__CHECK__
exit 0
fi
read -p "Scope (ex: umm): " SCOPE
read -p "ModuleName (ex: cafu_xxx): " MODULE_NAME
read -p "Description: " DESCRIPTION
read -p "GitHub Orgs (default: $SCOPE): " ORGANIZATIONS
read -p "GitHub Repository (default: $MODULE_NAME): " REPOSITORY
if [ -z "$ORGANIZATIONS" ]; then
ORGANIZATIONS=$SCOPE
fi
if [ -z "$REPOSITORY" ]; then
REPOSITORY=$MODULE_NAME
fi
git clone [email protected]:umm/_template_module.git $MODULE_NAME
cd $MODULE_NAME
rm -Rf .git/
git init
git remote add origin [email protected]:$ORGANIZATIONS/$REPOSITORY.git
yarn
npm run umm:init "@$SCOPE/$MODULE_NAME" "$DESCRIPTION"
cat <<__INSTRUCTION__
🚀 What's next?
cd $MODULE_NAME
# edit README.md
# edit package.json
git add .
git commit -m ":hatching_chick: Initialized"
git push origin master
Enjoy your development 🌟
__INSTRUCTION__
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment