Repository navigation
Release v1.5.11: command name follows argv[0], Windows installer fix - #209
Merged
Merged
Conversation
The root command now takes its name from os.Args[0], so a copy installed under another name (install.sh INSTALLED_NAME) shows that name in help, examples, flag usages, errors, update notices and completion scripts. Help and error text stays authored with the canonical "flashduty" and is rewritten to the invoked name at startup; the default name runs the tree unchanged. Completion scripts are now generated by the installed binary under its own name, so install.sh no longer rewrites them with sed. The bundled skill and its scripts now call the CLI by its default name, flashduty, and help strings that used another name now use flashduty.
`update` now resolves the running binary (os.Executable, symlinks resolved) and passes its directory and file name to the installer as FLASHDUTY_INSTALL_DIR and INSTALLED_NAME, so a copy installed under another name or directory is replaced in place instead of a fresh default-named copy being installed elsewhere. install.ps1 honors INSTALLED_NAME and moves an existing .exe aside before installing, since Windows cannot overwrite a running executable. Also: treat "$" in the invoked name literally when rewriting help text, strip the ".exe" suffix case-insensitively, and note why the version line keeps its fixed "flashduty version" prefix.
Name the CLI after the command word it was invoked as
Builds stub release archives locally and serves them through an Invoke-WebRequest stand-in, then checks the default name, INSTALLED_NAME in either case, and reinstalling while the installed exe (or its moved-aside copy) is running, under Windows PowerShell 5.1 and PowerShell 7.
Each reinstall moved the existing exe to the fixed name <name>.exe.old. If the copy moved aside by an earlier reinstall was still running, that file could be neither deleted nor replaced, so the next reinstall failed with "Cannot create a file when that file already exists". Move the exe aside under a unique name instead and delete earlier copies that are no longer running.
Run install.ps1 behavior tests on Windows
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Release branch for v1.5.11.
argv[0]: help, errors and shell completion sayfdutywhen the binary is installed asfduty.updatereplaces the running binary in place (keeps its install dir and name).install.shno longer rewrites completion withsed;install.ps1honorsINSTALLED_NAME. The bundledskills/flashdutyusesflashduty.install.ps1behavior tests on PowerShell 5.1 and 7, plus a fix they found: an executable that was moved aside while still running made the next install fail ("Cannot create a file when that file already exists"); it is now moved aside under a unique name and stale copies that are no longer running are cleaned up.Testing
CI on the branch head: build (ubuntu / macos / windows), lint, CodeQL, shellcheck, install.ps1 behavior (6/6 cases on both shells).
make checkandmake check-cardspass locally.Release
Merging updates the mirrored install scripts; tag
v1.5.11on the merge commit right after.