Closed aryarm closed 6 years ago
readlink
and stick it in the .bash_cds file. this could be copy-pasted from the internetreal_path()
cds
's symlinksI think I also use this in my install script, so this is something we should consider handling.
NOTE: I'm now using realpath
and it seems to be working. (See my install script for details.) Does it work for all systems, though?
EDIT: According to #13, it doesn't seem like realpath
is universally supported either?
For posterity (meaning us in about a week, probably): We're using a C realpath method. (Executable included in repo so users don't have to do stuff.)
Do we see ourselves ever needing the C code? What are your feelings about keeping it?
Also, currently realpath is called using the ./realpath
notation. However, this allows realpath to only be called from executables in the same directory as realpath (ie the cds
command can't call it).
Maybe we could create an alias function for realpath in .bash_nav? Would that solve the problem?
EDIT: I guess that would make .bash_nav a dependency of .bash_cds. Ugh.
For posterity, our current plan is to use setup to create a variable accessible to all files that are included by .included. This variable would hold a string representing the path to the repository directory. Then, all of the other files in the repository could use this variable directly or use it to call realpath. See issue #25.
The
readlink
command, whichcds
uses to get the absolute, target path for a symlink, is not supported on all systems, especially Macs. It apparently doesn't have good alternatives.