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

GNU ln compatibility patch #1

Closed
RonGee opened this issue Dec 14, 2020 · 2 comments
Closed

GNU ln compatibility patch #1

RonGee opened this issue Dec 14, 2020 · 2 comments
Assignees

Comments

@RonGee
Copy link

RonGee commented Dec 14, 2020

Using solo-agent on Linux. GNU ln does not have -h but it has -n
On the Mac, ln supports -n as an alias for -h, so to make solo-agent work on both,


~ diff -uN ~/bin/solo-agent.orig ~/bin/solo-agent    
--- ~/bin/solo-agent.orig  2020-06-15 23:47:04.000000000 -0400
+++ ~/bin/solo-agent   2020-12-13 20:19:58.241864747 -0500
@@ -126,7 +126,7 @@
     SSH_AUTH_SOCK="$(canonical_socket "${SSH_AUTH_SOCK}")"
     export SSH_AUTH_SOCK
     # Link to ID_SOCK for easy use/reference
-    ln -fhs "${SSH_AUTH_SOCK}" "${ID_SOCK}"
+    ln -fns "${SSH_AUTH_SOCK}" "${ID_SOCK}"
 fi
 # Display Variables
 display_variables
@TimidRobot TimidRobot self-assigned this Dec 17, 2020
@TimidRobot
Copy link
Owner

GNU Coreutils ln manpage excerpts:

       -n, --no-dereference
              treat  LINK_NAME as a normal file if it is a symbolic link to a di‐
              rectory

macOS BSD ln manpage excerpts:

     -h    If the link_name or link_dirname is a symbolic link, do not fol-
           low it.  This is most useful with the -f option, to replace a
           symlink which may point to a directory.
     -n    Same as -h, for compatibility with other ln implementations.

@TimidRobot
Copy link
Owner

Thank you @RonGee !

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