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

Fix process.argv propagation #341

Merged
merged 4 commits into from
Feb 2, 2021
Merged

Fix process.argv propagation #341

merged 4 commits into from
Feb 2, 2021

Conversation

72636c
Copy link
Member

@72636c 72636c commented Feb 2, 2021

skuba node and skuba start weren't even making an attempt to propagate command-line arguments to process.argv in the underlying entry point script. This is a dealbreaker for the former command as it's fairly common to want to run arbitrary scripts that take arguments, e.g. skuba node cli/dropAllTables.ts --force.

To maintain compatibility some tricky parsing is required, because we currently route arguments to a bunch of different places. The wrapper interplay is somewhat simplified by moving some arguments to environment variables.

I also uncovered that ts-node doesn't like Node.js inspector options, so we now run scripts using plain node. What could go wrong with all these layers upon layers?

`skuba node` and `skuba start` weren't even making an attempt to
propagate command-line arguments to `process.argv` in the underlying
entry point script. This is a dealbreaker for the former command as it's
fairly common to want to run arbitrary scripts that take arguments, e.g.
`skuba node cli/dropAllTables.ts --force`.

To maintain compatibility some tricky parsing is required, because we
currently route arguments to a bunch of different places. The wrapper
interplay is somewhat simplified by moving some arguments to environment
variables.

I also uncovered that `ts-node` doesn't like Node.js inspector options,
so we now run scripts using plain `node`. What could go wrong with all
these layers upon layers?
@72636c 72636c requested a review from a team as a code owner February 2, 2021 09:53
@changeset-bot
Copy link

changeset-bot bot commented Feb 2, 2021

🦋 Changeset detected

Latest commit: 13eea0a

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
skuba Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@72636c 72636c enabled auto-merge (squash) February 2, 2021 11:32
@72636c 72636c merged commit 8fce1be into master Feb 2, 2021
@72636c 72636c deleted the propagate-process-argv branch February 2, 2021 11:35
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