web-apis icon indicating copy to clipboard operation
web-apis copied to clipboard

Setup instructions assumes zsh and GNU tools?

Open foolip opened this issue 8 years ago • 5 comments

https://github.com/mdittmer/web-apis#serving-locally-for-development

. ./scripts/dev_env.sh results in the following errors on a Mac running bash:

dirname: illegal option -- b
usage: dirname path
readlink: illegal option -- f
usage: readlink [-n] [file ...]

The BSD readline doesn't have the -f option. And there's something different about what $0 means I guess.

foolip avatar Sep 22 '17 20:09 foolip

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.

foolip avatar Jan 03 '18 21:01 foolip

Had trouble on Debian as well, but installing zsh is all that's needed.

foolip avatar Jan 09 '18 16:01 foolip

@lukebjerring didn't we recently build a solution to the need for absolute URLs without readlink -f?

mdittmer avatar Jan 09 '18 18:01 mdittmer

@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.

foolip avatar Jan 21 '19 20:01 foolip

bandaid

mdittmer avatar Jan 22 '19 17:01 mdittmer