rename with execution order, add desc & initial creation script

This commit is contained in:
otofune
2017-11-07 23:38:18 +09:00
parent 12d815dc42
commit 04dd2cb12b
8 changed files with 40 additions and 0 deletions

37
tools/init-migration-file.sh Executable file
View File

@ -0,0 +1,37 @@
#!/bin/bash
usage() {
echo "$0 [-t type] [-n name]"
echo " type: [node | shell]"
echo " name: if no present, set untitled"
exit 0
}
while getopts :t:n:h OPT
do
case $OPT in
t) type=$OPTARG
;;
n) name=$OPTARG
;;
h) usage
;;
\?) usage
;;
:) usage
;;
esac
done
if [ "$type" = "" ]
then
echo "no type present!!!"
usage
fi
if [ "$name" = "" ]
then
name="untitled"
fi
touch "$(realpath $(dirname $BASH_SOURCE))/migration/$type.$(date +%s).$name.js"