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
Fix script bug where running from a subdirectory didn't work
This was always intended to work, but didn't because script
subprocesses always used the original command name/path, but this
was after changing directory.
The script already relies on the repository being organized a
particular way, so relying on itself (or another script suitable to
do its work) being at the known location is no worse. This also
makes it unnecessary to guard against the rare {}-in-path case.
This change has the further benefit that if the script is ever
successfully invoked via a Windows-style path with "\" separators
(which can happen on Windows), its subprocesses can still execute.
This also removes an altogether ineffective attempt to support the
rare case of a working tree whole top-level directory name ends in
a newline character, and instead changes the comment to note that
this does work. A few other comments throughout are reworded for
clarity as well.
It may make sense to change the script more deeply than this (even
before replacing part of it with a Rust tool). By sacrificing a
small amount of portability, a loop could be used, as find
recognizes -print0 in GNU/Linux (via GNU findutils), most BSD
systems including macOS, and busybox (thus also Alpine Linux).
Unfortunately a recursive glob, which would be even nicer, is not
supported by versions of bash that ship with macOS.
0 commit comments