File tree Expand file tree Collapse file tree 1 file changed +13
-2
lines changed Expand file tree Collapse file tree 1 file changed +13
-2
lines changed Original file line number Diff line number Diff line change 1
1
#! /bin/sh
2
2
3
- dir=` dirname " $( readlink " $0 " ) " `
3
+ # http://stackoverflow.com/questions/59895/can-a-bash-script-tell-what-directory-its-stored-in
4
+ source=" ${BASH_SOURCE[0]} "
5
+ while [ -h " $source " ]; do # resolve $source until the file is no longer a symlink
6
+ dir=" $( cd -P " $( dirname " $source " ) " && pwd ) "
7
+ source=" $( readlink " $source " ) "
8
+ # if $source was a relative symlink, we need to resolve
9
+ # it relative to the path where the symlink file was located
10
+ [[ $source != /* ]] && source=" $dir /$source "
11
+ done
12
+ dir=" $( cd -P " $( dirname " $source " ) " && pwd ) "
4
13
5
- node $dir /../cpu-daemon.js & > $dir /../logs/cpu-daemon.log &
14
+ project_dir=" $( dirname " $dir " ) "
15
+
16
+ node $project_dir /cpu-daemon.js & > $project_dir /logs/cpu-daemon.log &
You can’t perform that action at this time.
0 commit comments