-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcpScript.sh
57 lines (51 loc) · 1.14 KB
/
cpScript.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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
# script to copy DEV page markup to PROD file
echo "Copy DEV markup to PROD y/n ?"
read m
if [ $m == "y" ]
then
cp ./PAGE_TEST_DEV/homePage.html ./backend/views/testHomePage.ejs
echo "-- copied DEV markup into PROD --"
fi
echo
# for some reason my sass compiler is not watching my PROD css folder,
# hence a scipt to copy DEV folder content into PROD"
echo "Copy DEV css folder to PROD y/n ?"
read c
if [ $c != "y" ]
then
echo "-__-"
exit
fi
# deleting bloat files ending with PAGE
index="PAGE"
ls ./frontend/public/css | while read item
do
if grep -q "$index" <<< "$item"
then
rm "./frontend/public/css/$item"
echo "file $item removed"
fi
done
echo
# removing existing prod files & folders
ls -d ./frontend/sass/homePage/* | while read item
do
if [ -d $item ]
then
rm -r $item
else
rm $item
fi
done
echo "-- deleted existing files & folders --"
# copying dev files & folders to prod
ls -d ./PAGE_TEST_DEV/sass/homePage/* | while read item
do
if [ -d $item ]
then
cp -r $item ./frontend/sass/homePage/
else
cp $item ./frontend/sass/homePage
fi
done
echo "-- copied DEV css folder contents to PROD --"