fix(cli): adds skip override flag#5
Merged
sterlingwes merged 9 commits intoFullscript:mainfrom Dec 11, 2025
Merged
Conversation
sterlingwes
reviewed
Dec 11, 2025
Collaborator
sterlingwes
left a comment
There was a problem hiding this comment.
Looks great! Couple suggestions
Thanks for backfilling more specs ✨ 😌
src/cli/main.ts
Outdated
| .filter((_, i) => { | ||
| const originalIndex = i + 2; | ||
| return originalIndex !== skipIfEnvIndex && originalIndex !== skipIfEnvIndex + 1; | ||
| }); |
Collaborator
There was a problem hiding this comment.
splice here would be fine if we created a copy of the args argument to be safe?
const commandArgs = args.slice();
const skipIfEnvIndex = commandArgs.indexOf("--skip-if-env");
const skipIfEnv = skipIfEnvIndex > 0 ? commandArgs[skipIfEnvIndex + 1] : null;
commandArgs.splice(skipIfEnvIndex, 2);also allows for getting rid of getOptionValue alongside the filter
sterlingwes
reviewed
Dec 11, 2025
src/cli/main.ts
Outdated
| if (command === "override") { | ||
| if (shouldSkip(skipIfEnv)) { | ||
| return; | ||
| } |
Collaborator
There was a problem hiding this comment.
i think we put this at the top of the run() here b/c the way it's documented it's a global CLI option and not specific to one command
Co-authored-by: Wes Johnson <swj@wesquire.ca>
sterlingwes
approved these changes
Dec 11, 2025
Collaborator
sterlingwes
left a comment
There was a problem hiding this comment.
Nice all good after these
src/cli/main.ts
Outdated
| const flagsToEnable = new Set<string>(); | ||
| args.slice(2).forEach((arg) => { | ||
|
|
||
| const argsCopy = [...args].slice(2); |
Collaborator
There was a problem hiding this comment.
slice returns a copy i believe so the spread is not necessary here
Co-authored-by: Wes Johnson <swj@wesquire.ca>
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.
Add
--skip-if-envoption to override commandSummary
Adds a new
--skip-if-env <ENV_VAR>option to theoverridecommand that skips execution when the specified environment variable is set.Usage
yarn build-flags override --skip-if-env EAS_BUILD +localFlag -otherFlagWhen
EAS_BUILDis set in the environment, the command logs a skip message and exits without modifying flags.Changes
getOptionValuehelper to extract option values from argsparseArgsto handle--skip-if-envoptionoverridecommand handler