emacs-eldev / eldev

Elisp development tool
https://emacs-eldev.github.io/eldev/
GNU General Public License v3.0
227 stars 17 forks source link

Fix windows script update #48

Closed juergenhoetzel closed 3 years ago

juergenhoetzel commented 3 years ago

This is really an obscure issue. Fixes:

             Cannot locate installed script `eldev.ps1', skipping
             Cannot locate installed script `eldev.bat', skipping

and

[00:14.519]  Stdout contents:
             Upgraded or installed 1 package
             Upgraded script `c:/Users/PIDSLE~1/AppData/Local/Temp/eldev-xoazUY-test-bin/bin/eldev.ps1'
             Upgraded script `c:/Users/PIDSLE~1/AppData/Local/Temp/eldev-xoazUY-test-bin/bin/eldev.bat'

[00:14.530]  Stderr contents:
             [1/1] Upgrading package `eldev' (0.9.2snapshot -> 999.9) from `bootstrap-pa'...
             Der Befehl "--" ist entweder falsch geschrieben oder
             konnte nicht gefunden werden.

Appending the "rem" comment instead of prepending fixes the issue.

Running a .bat script while it is updating itself seems to lead to obscure errors as listed above.

doublep commented 3 years ago

Thank you! Using file-name-base instead of file-name-nondirectory was really my mistake, I just never noticed since on non-Windows the file is called without extension, so they both give the same result in that specific case. But some other things I wouldn't be able to catch without access to Windows at all.