-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.sh
More file actions
16 lines (13 loc) · 841 Bytes
/
main.sh
File metadata and controls
16 lines (13 loc) · 841 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#!/bin/bash
echo "sourcing ~~/main.sh to build dev.d files"
# We need to discover where this script is located so we can properly enter the Javascript logic
# We will resolve this script's source to an absolute path and store it as an global runtimeOptions variable called DEVD
script_source="${BASH_SOURCE[0]}"
while [ -h "$script_source" ]; do # resolve $script_source until the file is no longer a symlink
DEVD="$(cd -P "$(dirname "$script_source")" >/dev/null 2>&1 && pwd)"
script_source="$(readlink "$script_source")"
[[ $script_source != /* ]] && script_source="$DEVD/$script_source" # if $script_source was a relative symlink, we need to resolve it relative to the path where the symlink file was located
done
DEVD="$(cd -P "$(dirname "$script_source")" >/dev/null 2>&1 && pwd)"
export DEVD
node "${DEVD}/src/build.js" $DEVD