fix(hermes): Policy.ts CLI no longer discards the destination when --launcher is absent - #1863
Open
hjbrandt wants to merge 1 commit into
Open
Conversation
…launcher is absent When --launcher is not passed, launcherIdx is -1 and the filter's 'i !== launcherIdx + 1' excludes argv[0] — the destination itself — so 'bun Policy.ts <dest>' prints to stdout and never writes the file, exit 0. Guard the sentinel: only skip the value slot when --launcher was actually passed. Fixes danielmiessler#1859
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.
Fixes #1859.
Policy.ts's CLI filters--launcherand its value out ofargvbefore reading the positional destination:When
--launcheris absent,launcherIdxis-1andi !== launcherIdx + 1excludes index 0 — the destination itself.bun Policy.ts <dest>then prints to stdout and never writes the file, exit 0.Change (one file,
LifeOS/install/LIFEOS/HERMES/Policy.ts): guard the sentinel value so the value-slot exclusion only applies when--launcherwas actually passed.Verified:
bun Policy.ts /tmp/policy.jsonwrites the file and prints the✓ policy v…line;bun Policy.ts --launcher name /tmp/policy.jsonunchanged; no-arg stdout form unchanged.