-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
run
executable file
·55 lines (46 loc) · 1.55 KB
/
run
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
#!/bin/bash
# default command tasks
COMMAND="${1:-tasks}"
COMMAND_OPTION_1=$2
# ✨ List all tasks ✨
function tasks() {
echo ""
echo "Howdy! 👋"
echo "Note: If this is your first time running this script, you might want to run './run *_initialSetup'"
echo ""
echo "🪜 Listing available tasks ⏳"
echo ""
compgen -A function $COMMAND_OPTION_1
}
# ✨ Initial setup ✨
function nodejs_initialSetup() {
nodejs_installDeps
nodejs_build
}
# ✨ Node.js install dependencies ✨
function nodejs_installDeps() {
echo "📦 Installing nodejs dependencies... ⏳"
cd nodejs-tools/ && npm install && cd ..
echo "📦 Installing nodejs dependencies completed ✅"
}
# ✨ Node.js clean project ✨
CLEAN_NODEJS="npx -y rimraf package-lock.json node_modules dist .turbo build"
function nodejs_clean() {
echo "🗑️ Cleaning nodejs-tools generated files... ⏳"
cd nodejs-tools && npm exec --include-workspace-root --workspaces -- $CLEAN_NODEJS && cd ..
echo "🗑️ Cleaning nodejs-tools generated files completed ✅"
}
# ✨ Node.js update packages ✨
function nodejs_packageUpdate() {
echo "📦 Updating nodejs-tools packages... ⏳"
cd nodejs-tools && ./node_modules/.bin/ncu -u -ws --root && cd ..
echo "📦 Updating nodejs-tools packages completed ✅"
}
# ✨ Node.js build ✨
function nodejs_build() {
echo "📦 Building nodejs-tools... ⏳"
cd nodejs-tools && npm run build && cd ..
echo "📦 Building nodejs-tools completed ✅"
}
# Execute the function name provided to the script as the first argument
$COMMAND