-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.sh
More file actions
executable file
·44 lines (33 loc) · 1018 Bytes
/
build.sh
File metadata and controls
executable file
·44 lines (33 loc) · 1018 Bytes
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
#!/bin/zsh
# USER SPECIFIC VARIABLES:
ROOT_PATH="/Users/davidperez/Documents/Capstone/Sundial/cli"
NODE="node18"
PLATFORM="macos"
ARCH="arm64"
UPDATED_CRONTAB="/tmp/updated_crontab"
# BUILD SCRIPT
# Package project
cd $ROOT_PATH
npm run convert
pkg --target $NODE-$PLATFORM-$ARCH ./lib/index.js
# Transfer executable to bin
# sudo rm /usr/local/bin/sundial
sudo mv ./index /usr/local/bin/sundial
# Grant read permissions
chmod +x /usr/local/bin/sundial
# Cleanup
rm -r $ROOT_PATH/lib
# Kill old server processes if they exist
# Can also run this when done to terminate server process
# pkill -f "node server.js"
# Http server
# cd ./http_server
# npm install
# Start the server as forgeround process for debugging
# node server.js
# COMMENT OUT THIS SECTION (LINES 25-30) IF YOU'D LIKE TO AVOID MODIFYING CRONTAB
# Append crontab with example cronjobs + output to log
# crontab -l > $UPDATED_CRONTAB
# cat $ROOT_PATH/samples/cronjobs.txt >> $UPDATED_CRONTAB
# crontab $UPDATED_CRONTAB
# rm $UPDATED_CRONTAB