-
Notifications
You must be signed in to change notification settings - Fork 6
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
Docker run options. #7
base: master
Are you sure you want to change the base?
Docker run options. #7
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@arthurgreef Thanks for the improvement!
Just one issue that I have with passing string to spawn.
this._settings.rnodeDockerImage, ...runCmd('/vscode/.rnode'), | ||
]) | ||
] | ||
runOptions && runOptions.length != 0 && cmd.push(`${runOptions}`) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is tricky part. spawn
accepts arguments separated in a list and not in one string. But just to split by space can also be problematic if space is part of the value.
I wrote helper function to parse arguments by -
to an object.
https://github.com/tgrospic/rnode-grpc-js/blob/a6ae689/src/cli/args.js#L30
This is how it's used. For now object can be transformed to a list and just appended. Later we can add merging of objects.
https://github.com/tgrospic/rnode-grpc-js/blob/a6ae6894/src/cli/index.js#L60
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure we can use your function. I have an option like --network=host but your function strips the dashes. I need an array like ['--network', 'host'] not ['network','host']. Am I understanding that you want a modified version of your version to return lists of string arrays with the dashes intact?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, you are right. With equal sign will not work. And also multiple parameters like -p 123 -p 456
are generated as a list for this key { p: [123, 456] }
.
Maybe there already exists some nice lib for what we need here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
elsewhere in vs-code config, JSON is used to represent structured args.
No description provided.