-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpreparar.sh
54 lines (48 loc) · 1.53 KB
/
preparar.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
#!/usr/bin/env bash
set -o pipefail
IFS=$'\n\t'
if [[ "dependencias" == "$1" || "todo" == "$1" ]]; then
echo "* Comprobando dependencias..."
makensis -VERSION > /dev/null
if [[ 0 == "$?" ]]; then
echo "nsis está instalado"
else
echo "nsis no está instalado"
fi
neu version > /dev/null
if [[ 0 == "$?" ]]; then
echo "neutralino está instalado"
else
echo "neutralino no está instalado"
fi
gcab --version > /dev/null
if [[ 0 == "$?" ]]; then
echo "gcab está instalado"
else
echo "gcab no está instalado"
fi
fi
if [[ "versionar" == "$1" || "todo" == "$1" ]]; then
echo "* Modificando versión a $2..."
sed -i -E "s/(.+<meta name=\"versionNumero\" content=\").*(\".+)/\1$2\2/" public/index.html
sed -i -E "s/(.+<meta name=\"versionFecha\" content=\").*(\".+)/\1$(date --utc)\2/" public/index.html
sed -i -E "s/(.+\"version\": \").*(\",)/\1$2\2/" neutralino.config.json
fi
if [[ "compilar" == "$1" || "todo" == "$1" ]]; then
echo "* Compilando..."
neu build
fi
if [[ "instalador" == "$1" || "todo" == "$1" ]]; then
echo "* Generando instaladores..."
mkdir -p dist/instalador
sed "3 a \!define VERSION $2" < instalador.nsi | makensis -
fi
if [[ "portable" == "$1" || "todo" == "$1" ]]; then
echo "* Generando portable..."
mkdir -p dist/portable
gcab -n -c dist/portable/z80_portable.cab dist/z80/z80-win_x64.exe dist/z80/resources.neu
fi
if [[ "limpiar" == "$1" ]]; then
echo "* Limpiando todo"
rm -r dist/*
fi