forked from AreYouARobot/Robot
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathFolderCreationScript.sh
More file actions
executable file
·49 lines (37 loc) · 1.13 KB
/
FolderCreationScript.sh
File metadata and controls
executable file
·49 lines (37 loc) · 1.13 KB
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
#!/bin/bash
# Bash script to easily create folders for new client- and server-side modules
# Read in LOC (client or server), PATH, and MODULES (as many modules as you want to add as space-separated parameters)
# Example use:
# FROM ROOT, to add three new modules within client/app, write ./FolderCreationScript.sh client client/app module1 module2 module3
# FROM ROOT, to add two new modules within server/api, write ./FolderCreationScript.sh server server/api module1 module2
# See the README for more instructions!
LOC=$1
TESTPATH=$2
ARGS=("$@")
COUNT=$#
START=2
cd $TESTPATH
while [ $START -lt $COUNT ]; do
CURRENTMODULE=${ARGS[$START]}
echo "Creating files for $CURRENTMODULE module."
mkdir $CURRENTMODULE
cd $CURRENTMODULE
if [ $LOC = 'client' ]
then
touch $CURRENTMODULE.controller.js
touch $CURRENTMODULE.controller.spec.js
touch $CURRENTMODULE.css
touch $CURRENTMODULE.html
touch $CURRENTMODULE.js
fi
if [ $LOC = 'server' ]
then
touch index.js
touch $CURRENTMODULE.controller.js
touch $CURRENTMODULE.model.js
touch $CURRENTMODULE.model.spec.js
touch $CURRENTMODULE.spec.js
fi
let START=START+1
cd ..
done