-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathrunFrontend.sh
executable file
·50 lines (45 loc) · 1.15 KB
/
runFrontend.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
# Instruktioner:
# Första gången: Kör denna fil
# Sedan: Kör endast yarn run start
checkInstalled() {
if ! [ -x "$(command -v $@)" ]; then
echo "Error: $@ is not installed." >&2
fi
}
show_help() {
echo "Usage: ./runFrondend.sh [OPTIONS]"
echo "Script for running the frontend"
echo ""
echo "Options:"
echo "-h, --help Display this help message and exit"
echo "-n, --renode Reinstall node_modules"
echo "-c, --recli Install sharp-cli"
echo "-s, --ressl Add ssl"
echo ""
echo ""
}
checkInstalled yarn
while getopts ":h:n:c:s" opt; do
case $opt in
h|help)
show_help
exit 1
;;
n|renode)
# Reinstall node_modules
sudo rm -rf node_modules
yarn install
exit 0
;;
c|recli)
# Install sharp-cli
sudo yarn add sharp-cli@^2.1.0 --global
;;
s|ressl)
# Lägg till vid problem med ssl. (opensslErrorStack)
#Kan leda till att unset NODE_OPTIONS behöver köras innan VSCode kan köras igen
export NODE_OPTIONS=--openssl-legacy-provider
;;
esac
done
yarn run start