-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.backup-mktest.fish
150 lines (135 loc) · 5.79 KB
/
.backup-mktest.fish
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
# Defined in /Users/admin/.config/fish/functions/mktest.fish @ line 2
function mktest
cd ~/webdev/JS/test-projects
# set normal (set_color normal)
# set greenU (set_color green --underline)
# if test -n "$argv"
if begin
[ $argv[1] = '--help' ]
or [ $argv[1] = '-h' ]
or [ $argv[1] = 'help' ]
end
set normal (set_color normal)
set ital (set_color normal)
set dim (set_color normal)
set trueDim (set_color 989898)
set blueU (set_color blue -u)
set blue (set_color blue -o)
set green (set_color green)
set greenB (set_color green -o)
set yellow (set_color yellow -u -o)
set red (set_color red)
echo -e '\n\t\t'"$yellow"'Make Test'"$normal"' '"$trueDim"'(Custom Command)\n'
echo -e '\t'"$normal"'Project generator for testing things quickly\n\twith no other setup required.\n'
echo -e '\t'"$blueU"'Usage'"$normal"': '"$greenB"'mktest'"$normal"' ['"$blue"'options'"$normal"'] or ['"$blue"'existing project'"$normal"']\n'
#echo -e '\t'"$red"'Project generator for testing things quickly\n\twith no other setup required.\n'
echo -e '\t'"$blueU"'Options'"$normal"':\n'
echo -e '\t '"$green"'-t'"$normal"', '"$green"'--type '"$normal"' ['"$blue"'type'"$normal"'] ['"$blue"'new project name'"$normal"']'
echo -e '\t '"$dim"'Generates new project from customized\n\t boilerplates and begins tracking with git\n'
echo -e '\t'"$blueU"'Boilerplate Types'"$normal"':\n'
echo -e '\t '"$green"'empty'"$dim"' - Scaffolds basic blank project'
echo -e '\t '"$green"'node'"$dim"' - Blank nodejs setup'
echo -e '\t '"$green"'exp'"$dim"' - Basic express server'
echo -e '\t '"$green"'exp-seq'"$dim"' - Express server with postgresSQL'
echo -e '\t '"$green"'react'"$dim"' - Simple react setup'
echo -e '\t '"$green"'redux'"$dim"' - React with redux setup'
echo -e '\t '"$green"'full'"$dim"' - Express, sequelize, react, react-redux\n'
set_color normal
else if begin
[ $argv[1] = '--type' ]
or [ $argv[1] = '-t' ]
end
set_color green
echo -e " - selected create new $argv[2] project...\n"
set_color cyan
if [ $argv[2] = 'full' ]
echo -e ' - generating new project -\n'
git clone -b express-sequelize-react-redux [email protected]:ev-dev/ev-dev-starter.git "$argv[3]"
rm -rf ./.git
git init
echo ' '
npm install
cm 'Initial Commit: Forked from custom full starter'
echo ' '
code .
else if [ $argv[2] = 'node' ]
echo -e ' - Generating basic node.js project -\n'
mkdir ./"$argv[3]"
cd "$argv[3]"
git init
npm init -y
touch app.js
add
cm 'Initial Commit: Only contains blank .js file'
echo ' '
code .
else if [ "$argv[2]" = 'exp-seq' ]
echo -e ' - Generating express/sequelize project -\n'
git clone -b express-sequelize [email protected]:ev-dev/ev-dev-starter.git "$argv[3]"
cd "$argv[3]"
rm -rf ./.git
git init
echo ' '
npm install
cm 'Initial Commit: Forked from custom express-sequelize starter'
echo ' '
code .
else if [ $argv[2] = 'react' ]
echo -e ' - Generating new react project -\n'
git clone -b react [email protected]:ev-dev/ev-dev-starter.git "$argv[3]"
cd "$argv[3]"
rm -rf ./.git
git init
echo ' '
npm install
cm 'Initial Commit: Forked from custom react starter'
echo ' '
code .
else if [ $argv[2] = 'redux' ]
echo -e ' - Generating new react-redux project -\n'
git clone -b react-redux [email protected]:ev-dev/ev-dev-starter.git "$argv[3]"
cd "$argv[3]"
rm -rf ./.git
git init
echo ' '
npm install
cm 'Initial Commit: Forked custom react-redux starter'
echo ' '
code .
# else if [ $argv[2] = 'fullstack' ]
# echo -e ' - Generating new react-redux-sequelize project -\n'
# git clone -b react-redux-sequelize [email protected]:ev-dev/ev-dev-starter.git "$argv[3]"
# cd "$argv[3]"
# rm -rf ./.git
# git init
# echo ' '
# npm install
# cm 'Initial Commit: Forked custom react-redux-sequelize starter'
# echo ' '
# code .
end
else
mkd ./"$argv[2]"
git init
echo ' '
end
# else
# echo -e ' - arguments not recongnized as command'
# echo -e ' - searching for project named \''"$argv"'\'\n'
# cd "$argv" >temp.txt ^&1
# if [ $status -ne 0 ]
# echo ' -- no project found with name...use \'maketest\' with no arguments to list contents of test-projects'
# echo -e ' -- or use \'maketest --help\' for a list of available commands\n'
# rm temp.txt
# else
# echo ' - project found...showing contents'
# lst
# end
# end
# else
# echo -e ' - no arguments selected...use \'maketest --help\' for a list of available commands'
# echo -e ' - entering \'test-projects\' root directory and showing contents\n'
# ls -1 -C
# echo ' '
# end
end