Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Setup instructions assumes zsh and GNU tools? #41

Open
foolip opened this issue Sep 22, 2017 · 5 comments
Open

Setup instructions assumes zsh and GNU tools? #41

foolip opened this issue Sep 22, 2017 · 5 comments

Comments

@foolip
Copy link
Collaborator

foolip commented Sep 22, 2017

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
Copy link
Collaborator Author

foolip commented Jan 3, 2018

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
Copy link
Collaborator Author

foolip commented Jan 9, 2018

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

@mdittmer
Copy link
Owner

mdittmer commented Jan 9, 2018

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

@foolip
Copy link
Collaborator Author

foolip commented Jan 21, 2019

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

@mdittmer
Copy link
Owner

bandaid

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants