Last active
February 7, 2020 01:56
-
-
Save wmichi/de802f05a4967da21f34b3a07aef20b3 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
function AskProjectName() { | |
echo "プロジェクトディレクトリを作成しますか?(y/n)" | |
read input | |
if [ $input = 'YES' ] || [ $input = 'Yes' ] || [ $input = 'yes' ] || [ $input = 'Y' ] || [ $input = 'y' ] ; then | |
InputName | |
ConfirmInput | |
dirname=$projectname | |
mkdir $dirname | |
cd $dirname | |
elif [ $input = 'NO' ] || [ $input = 'No' ] || [ $input = 'no' ] || [ $input = 'N' ] || [ $input = 'n' ] ; then | |
ConfirmProjectName | |
echo "カレントディレクトリに作成します" | |
else | |
echo "入力が不正です" | |
AskProjectName | |
fi | |
} | |
function InputName(){ | |
echo "プロジェクト名を入力してください" | |
read input | |
projectname=$input | |
if [ -z $input ] ; then | |
echo "1文字以上入力してください" | |
InputName | |
fi | |
} | |
function ConfirmInput(){ | |
echo "こちらでよろしいですか? (y/n)" | |
read input | |
if [ $input = 'NO' ] || [ $input = 'No' ] || [ $input = 'no' ] || [ $input = 'N' ] || [ $input = 'n' ] ; then | |
InputName | |
elif [ $input = 'YES' ] || [ $input = 'Yes' ] || [ $input = 'yes' ] || [ $input = 'Y' ] || [ $input = 'y' ] ; then | |
echo "ディレクトリを作成します。" | |
else | |
echo "入力が不正です" | |
ConfirmInput | |
fi | |
} | |
function ConfirmProjectName(){ | |
echo "本当にカレントディレクトリに作成して良いですか? ? (y/n)" | |
read input | |
if [ $input = 'NO' ] || [ $input = 'No' ] || [ $input = 'no' ] || [ $input = 'N' ] || [ $input = 'n' ] ; then | |
AskProjectName | |
elif [ $input = 'YES' ] || [ $input = 'Yes' ] || [ $input = 'yes' ] || [ $input = 'Y' ] || [ $input = 'y' ] ; then | |
echo "ディレクトリを作成します。" | |
else | |
echo "入力が不正です" | |
ConfirmProjectName | |
fi | |
} | |
AskProjectName | |
echo "-------------------------------------------------------" | |
mkdir -p data/query data/org docs experiments log/model_results notebooks src test tmp | |
touch data/query/.gitkeep data/org/.gitkeep .gitignore docs/README.md experiments/.gitkeep log/model_results/result.csv notebooks/.gitkeep src/.gitkeep notebooks/.gitkeep test/.gitkeep test/.gitkeep ./README.md | |
echo "data/*.csv\ndata/*/*.csv\ntmp/\nexperiments/*\n!experiments/.gitkeep\nnotebook/*.ipynb_checkpoints\n*_test.ipynb\n*__pycache__" > .gitignore | |
echo "done" | |
echo "-------------------------------------------------------" | |
tree . |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment