-
Notifications
You must be signed in to change notification settings - Fork 0
/
django.sh
40 lines (36 loc) · 946 Bytes
/
django.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#!/bin/bash
sub_init() {
read -p 'Django Project Name: ' djangoProjectName
#echo "Project Name: $djangoProjectName"
pipenv install
pipenv install django
pipenv run django-admin startproject $djangoProjectName .
}
# Main
# https://gist.github.com/waylan/4080362
ProgName=$(basename $0)
sub_help(){
echo "Usage: $ProgName <subcommand> [options]\n"
echo "Subcommands:"
echo " init Init django project"
echo " baz Run baz"
echo ""
echo "For help with each subcommand run:"
echo "$ProgName <subcommand> -h|--help"
echo ""
}
subcommand=$1
case $subcommand in
"" | "-h" | "--help")
sub_help
;;
*)
shift
sub_${subcommand} $@
if [ $? = 127 ]; then
echo "Error: '$subcommand' is not a known subcommand." >&2
echo " Run '$ProgName --help' for a list of known subcommands." >&2
exit 1
fi
;;
esac