-
Notifications
You must be signed in to change notification settings - Fork 50
Create valid symbolic link to output dir #226
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
Conversation
Huh, interesting. What platform are you on? CLI tools sometimes have different behaviour across platforms, especially if they have been around a long time, so it would probably be good to check that this works in both macOS and Linux. |
Here's my system info:
|
Ok, thanks. Generally the tools on macOS systems are more similar to BSD versions, since that’s what mac is based on, and unfortunately it looks like the BSD version of ln doesn’t support long flags or the —relative flag: https://www.freebsd.org/cgi/man.cgi?ln I think the most portable option might be to use $PWD so that the links don’t have to be relative, something like |
I found this comment that says Let me try your idea. |
Nope. That doesn't work for me. Perhaps it would be easier to just note the two differences? |
What’s the error? I’m sure there’s a way of getting it to work in both systems. |
# cwd = `trypurescript/staging`
$ ln -sv output $PWD/../client/public/js/output
'/home/jordan/Programming/Projects/trypurescript/staging/../client/public/js/output' -> 'output'
# cwd = `trypurescript/client/public/js`
$ file output/Data.Foldable/index.js
output/Data.Foldable/index.js: cannot open `output/Data.Foldable/index.js' (Too many levels of symbolic links) |
Right ok, I think what you have there is the |
$ ln -s “$PWD/output” “$PWD/../client/js/output”
ln: failed to create symbolic link '“/home/jordan/Programming/Projects/trypurescript/staging/../client/js/output”': No such file or directory |
😆 This solution works, but only because it completely removes the relative path in the second argument cd client/public/js
ln -s ../../../staging/output/ . |
The “no such file or directory” error there is probably due to the fancy quotes, you’ll want to use normal ones |
You're right. I copy-pasted what you had above and didn't notice it had fancy quotes. Good catch! @thomashoneyman Can you confirm that this produces a valid symbolic link on your side? ln -s "$PWD/output" "$PWD/../client/public/js/output" |
Yep! Works for me. Though I don't need the quotes -- |
I need the quotes. Otherwise, it doesn't work. |
You'll need the quotes if you have spaces in any of the parent directories, such as if your username has a space in it. |
I was getting a 500 error in #225 (comment) because the symbolic link created via
ln -s output ../client/public/js/output
was broken.Adding the
--relative
flag fixes the issue for me. I get the same view Thomas did in #225.