This repository was archived by the owner on Mar 3, 2023. It is now read-only.
Convert arguments to absolute paths #17107
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This script launches cmd and has it launch atom with the passed arguments. The problem is that cmd will not (necessarily) start in the pwd. So, relative paths like
.
and..
have a different meaning. So we should first convert them to absolute paths with cygpath.Try it yourself. Go to some directory in bash and run
atom .
Rather than opening your current bash pwd, you'll open $HOME because when cmd opens, that's where it will be. Now apply this change and try the same thing.By the way, I only see this problem affecting MSysGit and MSys2. I can't say whether it affects other environments.
Requirements
Description of the Change
In environments where
cygpath
is available, use it to convert any paths passed toatom.sh
to absolute paths.Alternate Designs
None
Why Should This Be In Core?
Because it makes atom work properly on the command line.
Benefits
MSys users will be able to run
atom .
to open the current directory in atom.Possible Drawbacks
Probably none.
Verification Process
Tested as:
atom .
atom ..
atom . ..
As well as other combinations of relative and absolute paths. On both MSys2 and MSysGit
Applicable Issues
None