Open foolip opened 7 years ago
Ran into this again today on my Mac. Here are the changes I did to make it work:
diff --git a/scripts/dev_env.sh b/scripts/dev_env.sh
index 67d519d..1fdd782 100755
--- a/scripts/dev_env.sh
+++ b/scripts/dev_env.sh
@@ -2,7 +2,7 @@
# Source this file to setup development environment
-WD=$(readlink -f $(dirname "$0"))
+WD=$(dirname "$0")
NODE_PATH=$WD/..
NODEJS_BIN=$WD/../node_modules/.bin
diff --git a/scripts/serve.sh b/scripts/serve.sh
index 214d82a..ae8898f 100644
--- a/scripts/serve.sh
+++ b/scripts/serve.sh
@@ -1,6 +1,6 @@
#!/bin/zsh
-export SH_DIR=$(readlink -f $(dirname "$0"))
+export SH_DIR=$(dirname "$0")
GRAY='\033[0;47m'
GREEN='\033[0;32m'
And then . ./scripts/dev_env.sh
has to be run in zsh.
Had trouble on Debian as well, but installing zsh is all that's needed.
@lukebjerring didn't we recently build a solution to the need for absolute URLs without readlink -f
?
@mdittmer this is an issue I need to work around every time I collect data on macOS, and when I tried collecting using BrowerStack last week.
https://github.com/mdittmer/web-apis#serving-locally-for-development
. ./scripts/dev_env.sh
results in the following errors on a Mac running bash:The BSD readline doesn't have the -f option. And there's something different about what $0 means I guess.