forked from Power-Components/powergrid-doc
-
Notifications
You must be signed in to change notification settings - Fork 0
/
run.sh
executable file
·34 lines (23 loc) · 1.54 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
#!/bin/bash
#╔═════════════════════╗#
#║ PowerGrid Doc ║#
#╚═════════════════════╝#
# ══════════════ STYLES ═════════
NC='\033[0m'
GREEN='\033[0;32m'
LABEL_ERROR="\n\033[048;5;9m ERROR ${NC} "
#Ascii Logo encoded in Base64
LOGO=$(echo -n "ICAgICAgICAgICAgXDAzM1sxOzMzbSBfX1wwMzNbMG0gICAgIFwwMzNbMDszMm1fX19fICAgICAgICAgICAgICAgICAgICAgICAgICBfX19fX18gICAgIF8gICAgIF9fXDAzM1swbQogICAgICAgICAgICBcMDMzWzE7MzNtLyAvXyxcMDMzWzBtICBcMDMzWzA7MzJtLyBfXyBcX19fXyBfICAgICAgX19fX18gIF9fX19fLyBfX19fL19fX18oXylfX18vIC9cMDMzWzBtCiAgICAgICAgICAgIFwwMzNbMTszM20vXyAsJ1wwMzNbMG0gXDAzM1swOzMybS8gL18vIC8gX18gXCB8IC98IC8gLyBfIFwvIF9fXy8gLyBfXy8gX19fLyAvIF9fICAvIFwwMzNbMG0KICAgICAgICAgICAgXDAzM1sxOzMzbS8nXDAzM1swbSAgIFwwMzNbMDszMm0vIF9fX18vIC9fLyAvIHwvIHwvIC8gIF9fLyAvICAvIC9fLyAvIC8gIC8gLyAvXy8gLyAgXDAzM1swbQogICAgICAgICAgICAgICAgXDAzM1swOzMybS9fLyAgICBcX19fXy98X18vfF9fL1xfX18vXy8gICBcX19fXy9fLyAgL18vXF9fLF8vICAgXDAzM1swbSAg" | base64 --decode)
# ══════════════ FUNCTIONS ═════════
checkNpm () {
if ! npm --version >/dev/null 2>&1; then
echo -e "${LABEL_ERROR}${GREEN}Npm${NC} is required! Visit: https://nodejs.org/en/"
exit 1;
fi
}
# ══════════════ SCRIPT ═════════
echo -e "${LOGO}\n"
echo -e "🙏 Thank you for contributing!\n"
checkNpm
npm install
npm run docs:dev