-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdeploy.sh
More file actions
executable file
·45 lines (35 loc) · 1.04 KB
/
deploy.sh
File metadata and controls
executable file
·45 lines (35 loc) · 1.04 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
#!/bin/bash
# Go to the directory where the script is
cd "$(dirname "$0")"
# Remove folder if it exists
if [ ! -d deploy ]
then
mkdir deploy
fi
rm -rf deploy/*
echo "Copiando..."
printf "(function() {\n" > deploy/theScript.js
cat *.js >> deploy/theScript.js
printf "\n})();" >> deploy/theScript.js
cat css/cyborg.css css/estilos.css > deploy/theStyle.css
cp -rf img deploy/img
cp -rf snd deploy/snd
cp favicon.ico deploy/favicon.ico
cp index.html deploy/index.html
echo "Corrigiendo index.html..."
sed -e '/<!-- \/REEMPLAZAR -->/r auxDeploy' -e '/<!-- REEMPLAZAR -->/,/<!-- \/REEMPLAZAR -->/d' deploy/index.html > deploy/index_tmp
mv deploy/index_tmp deploy/index.html
echo "Uglifying..."
uglifyjs deploy/theScript.js --compress --mangle > deploy/theScript_tmp
mv deploy/theScript_tmp deploy/theScript.js
# Deploy to the web?
if [ "$1" == "-toWeb" ]; then
echo "Deploy to web..."
rm -rf ../david-campos.github.io/*
cp -rf deploy/* ../david-campos.github.io/
cd ../david-campos.github.io/
git add --all
git commit
git push
fi
echo "Done :)!"