Running Atom from shell doesn't work on Windows


Hi, this is my first post on Atom Discuss.

I was surprised recently when running atom file.txt from the Git shell for Windows (the new version, if that’s relevant) gave me an error saying .../atom: line 2: .../ No such file or directory. When I opened the script by doing a notepad $(which atom), I got this:

"$0/../../app-0.204.0/resources/cli/" "$@"

Realizing that $0 should have been $(dirname $0) instead, I replaced it and tried again. However, it seems that the script it points to ( also has this error, so I had to go there and replace it as well. I also found this bug when trying to use apm.

After that, everything worked perfectly.

The reason I came here was because after Atom updated, it completely erased all of my changes so I have to modify all 4 script files again.

Is there a way to make the fix permanent until this gets patched?



I wonder if it might work better if you call atom.cmd on Windows, instead of the shell script?


True, I just tried and it does work as expected. I was filing this as more along the lines of a bug report, though, for other unfortunate Git shell users who might not know this.