Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add command-line processing to update settings #2025

Merged
merged 24 commits into from
Apr 14, 2022
Merged

Conversation

ericpromislow
Copy link
Contributor

No description provided.

@ericpromislow ericpromislow changed the title 1222 command line args Add command-line processing to update settings Apr 12, 2022
Copy link
Contributor

@mook-as mook-as left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The functions need a lot more documentation before I can review it and have confidence that our understandings of what they're supposed to do match.

@ericpromislow
Copy link
Contributor Author

Forgot to mention that docs for accessing command-line args are at: #1222 (comment)

@ericpromislow ericpromislow force-pushed the 1222-command-line-args branch 2 times, most recently from 9e49fc0 to 9153e75 Compare April 13, 2022 00:06
@ericpromislow ericpromislow requested a review from mook-as April 13, 2022 20:14
@ericpromislow ericpromislow force-pushed the 1222-command-line-args branch from 291684d to 92470e6 Compare April 13, 2022 20:15
Copy link
Contributor

@mook-as mook-as left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The tests don't seem to be doing the right thing — the cfg is updated in-place, so it's just asserting that an object is the same as itself (rather than that it was the same as the previous value).

@ericpromislow ericpromislow requested a review from mook-as April 14, 2022 00:48
This needs to be tested on each platform in the following configurations:
- running a built app (default)
- running `npm run dev -- args...`
- running e2e tests

Signed-off-by: Eric Promislow <[email protected]>
Looks like a cheat to determine if we're running in dev mode, but it's the
only possibility that has .../dev.mjs at arg 4.

Signed-off-by: Eric Promislow <[email protected]>
Signed-off-by: Eric Promislow <[email protected]>
Add more typing, and reduce the code by returning null
on any failure.

Signed-off-by: Eric Promislow <[email protected]>
- mock `fs.writeFileSync` so that `updateFromCommandLine` can call
  `settings.save()` and unit tests don't do crazy things to the pref set.

Signed-off-by: Eric Promislow <[email protected]>
Signed-off-by: Eric Promislow <[email protected]>
Signed-off-by: Eric Promislow <[email protected]>
Otherwise we're just comparing an object with itself.

Signed-off-by: Eric Promislow <[email protected]>
Signed-off-by: Eric Promislow <[email protected]>
Signed-off-by: Eric Promislow <[email protected]>
Signed-off-by: Eric Promislow <[email protected]>
@ericpromislow ericpromislow force-pushed the 1222-command-line-args branch from ecbeab9 to 9d5fcd4 Compare April 14, 2022 17:49
@ericpromislow ericpromislow requested a review from mook-as April 14, 2022 20:28
@mook-as mook-as merged commit 630f8fc into main Apr 14, 2022
@mook-as mook-as deleted the 1222-command-line-args branch April 14, 2022 21:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants