Exec libexec/sub from bin/sub instead of symlinking #40

Open
wants to merge 1 commit into
from

Projects

None yet

2 participants

@evnm
evnm commented Nov 6, 2013

While trying to provide a tool built with sub as a gem, I learned that symlinks aren't maintained while building gems. This meant that bin/sub would be flattened into a copy of libexec/sub rather than remaining a symlink. This was problematic because the bin file within a gem must be a ruby script.

This change execs libexec/sub instead of symlinking, which removes a roadblock when gemifying sub projects.

@evnm evnm Exec libexec/sub from bin/sub instead of symlinking.
Symlinks aren't maintained while building gems, so bin/sub would be
flattened into a copy of libexec/sub rather than remaining a symlink.
This change execs libexec/sub instead of symlinking, which make it easier
to gemify sub projects.
34d4e94

I got bitten by this today after copying the file directory via scp. I hadn't ran into the problem with rsync or tar, so I wasn't expecting a problem with scp, but the version of scp I have didn't support symlinks, resulting an "command not found" error on the other end, because the top level command was found, but none of the sub-commands were found.

Short of avoiding symlinks, it would nice if this issue was detected-- the main script should be able to detect the right symlink is in place and throw a more helpful message if the symlink is expected but has been flattened.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment