23 lines
568 B
Bash
23 lines
568 B
Bash
#!/bin/bash
|
|
|
|
read -p "app_name [example]: " app_name
|
|
read -p "go_module [sandc]: " sandc
|
|
read -p "db_driver, mysql or postgres [postgres]: " db_driver
|
|
if [[ $app_name == "" ]]; then
|
|
app_name=example
|
|
fi
|
|
if [[ $go_module == "" ]]; then
|
|
go_module=sandc
|
|
fi
|
|
if [[ $db_driver == "" ]]; then
|
|
db_driver=postgres
|
|
fi
|
|
if [ -d "app/$app_name" ]; then
|
|
echo "app: $app_name already exists"
|
|
exit 1
|
|
fi
|
|
|
|
cookiecutter --no-input .tmpl app_name=$app_name go_module=$go_module db_driver=$db_driver
|
|
mv $app_name/api/$app_name api/
|
|
mv $app_name/app/$app_name app/
|
|
rm -rf $app_name |