run.sh 871 Bytes
Newer Older
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
#!/bin/bash
mode="dev"
docker="false"

#
# Run Script for AURA Engine Clock
#
# Call with one of these parameters:
#
# - dev
# - build
# 

if [[ $* =~ ^(dev|build)$ ]]; then 
	mode=$1 
fi

if [[ "$1" == *"docker:"* ]]; then
	docker="true"
	mode=${1#*:}
fi


echo "[ Run mode=$mode ]"
echo "[ Docker=$docker ]"



# +++ DEFAULT COMMANDS +++ #

if [[ $docker == "false" ]]; then

	### Runs the development server ###

	if [[ $mode == "dev" ]]; then
		npm run dev
	fi

	### Builds a package for production ###

	if [[ $mode == "build" ]]; then
        npm run build
        mkdir -p dist
        cp public/build/aura-clock-bundle.css dist/css/aura-clock-bundle.css
        cp public/build/aura-clock-bundle.js dist/js/aura-clock-bundle.js
	fi


fi


# +++ DOCKER COMMANDS +++ #

if [[ $docker == "true" ]]; then
	BASE_D=$(realpath "${BASH_SOURCE%/*}/")

    # ~~~ 404 ~~~
fi