-
Notifications
You must be signed in to change notification settings - Fork 61
/
run.sh
executable file
·75 lines (61 loc) · 1.6 KB
/
run.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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
#! /bin/sh
# ==============================================================================
# Description: Run and build scripts
# Author: Micle Bu, micle@oriovo.com
# Created On: 2018.03.18
# Updated On: 2018.03.18
# Quasar: http://quasar-framework.org/guide/quasar-cli.html
# ==============================================================================
APP="quasar-tiptap"
## Run from here
## -----------------------------------------------------------------------------
if [ $# -lt 1 ]
then
echo "Usage: $(basename "$0") dev|build|deploy|packager|builder [pwa|electron]"
exit 1
fi
## Params
## -----------------------------------------------------------------------------
type=$1
mode=$2
if [ -z "$mode" ]
then
mode="spa"
fi
## Preprocess
## -----------------------------------------------------------------------------
VERSION=$(cat package.json | python2 -c 'import json,sys;obj=json.load(sys.stdin);print obj["version"]')
echo "Building $APP $VERSION ..."
## Func
## -----------------------------------------------------------------------------
run_build() {
quasar "$type" -m "$mode"
}
run_deploy() {
cd dist/spa
git init
git add -A
git commit -m 'deploy: 🎉[skip ci]'
git push -f git@github.com:donotebase/quasar-tiptap.git master:gh-pages
cd -
}
electron_builder() {
quasar build -m electron -T all -b builder
cd dist/electron
cd -
}
## Run from here
## -----------------------------------------------------------------------------
case $type in
"deploy")
type="build"
run_build
run_deploy
;;
"builder")
electron_builder
;;
*)
run_build
;;
esac