Skip to content

Instantly share code, notes, and snippets.

@mattak
Last active July 25, 2018 04:16
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save mattak/f95a8f4c8750ee61aea79ec09d87f659 to your computer and use it in GitHub Desktop.
Save mattak/f95a8f4c8750ee61aea79ec09d87f659 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 git@github.com:umm/_template_module.git $MODULE_NAME
cd $MODULE_NAME
rm -Rf .git/
git init
git remote add origin git@github.com:$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__
@monry
Copy link

monry commented Jul 24, 2018

- read -p "ProjectName (cafu_xxx): " PROJECT_NAME
+ read -p "ModuleName (cafu_xxx): " MODULE_NAME
+ read -p "Scope (umm): " SCOPE

とかしたいかもです。
で、 npm run umm:init "@$SCOPE/$MODULE_NAME" "$DESCRIPTION" とするとヨサソウ。
(勿論、 s/$PROJECT_NAME/$MODULE_NAME/g

@monry
Copy link

monry commented Jul 25, 2018

https://gist.github.com/monry/f31a1f1bc486c11bcf1913a477542cf0
こんな感じでどーでしょか?

@mattak
Copy link
Author

mattak commented Jul 25, 2018

素敵っぽい ! ✨
自分のも修正しました!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment