You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hey, loving the activity on this project. Thanks for resolving #118 so quickly. I've now ported most of my projects to using argc, and I'm seeing how far I can push it.
It's great that argc automatically cds into the directory of the Argcfile.sh it finds in the parent hierarchy; this is generally the thing that a script author wants. However, if the command accepts a filename argument, the filename is invalid when the script gets run. See this Argcfile for an example:
mkdir directory
cd directory
touch test.txt
argc test.txt
The script fails, because the file does not exist, because the directory was changed.
I can think of a few options here:
Export ARGC_ORIGINAL_PATH or some other variable, which contains the path of the original pwd.
For <FILE/DIR/PATH> arguments, they are automatically prefixed with the appropriate path.
The first option seems like the best overall to me. The second requires that the argument values are tagged properly, and there could also be use cases where we don't need a specific argument, but we still want to know the original directory of the command.
Thanks for your consideration!
The text was updated successfully, but these errors were encountered:
Hey, loving the activity on this project. Thanks for resolving #118 so quickly. I've now ported most of my projects to using argc, and I'm seeing how far I can push it.
It's great that argc automatically cds into the directory of the Argcfile.sh it finds in the parent hierarchy; this is generally the thing that a script author wants. However, if the command accepts a filename argument, the filename is invalid when the script gets run. See this Argcfile for an example:
Run this script:
The script fails, because the file does not exist, because the directory was changed.
I can think of a few options here:
ARGC_ORIGINAL_PATH
or some other variable, which contains the path of the original pwd.The first option seems like the best overall to me. The second requires that the argument values are tagged properly, and there could also be use cases where we don't need a specific argument, but we still want to know the original directory of the command.
Thanks for your consideration!
The text was updated successfully, but these errors were encountered: