Skip to content

windows_utils.bzl: Escaping \ and " before passing args to bash scrip…#1685

Merged
alexeagle merged 6 commits into
masterfrom
meteorcloudy-patch-2
Mar 6, 2020
Merged

windows_utils.bzl: Escaping \ and " before passing args to bash scrip…#1685
alexeagle merged 6 commits into
masterfrom
meteorcloudy-patch-2

Conversation

@meteorcloudy
Copy link
Copy Markdown
Collaborator

@meteorcloudy meteorcloudy commented Mar 4, 2020

…t with quote

PR Checklist

Please check if your PR fulfills the following requirements:

  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been added / updated (for bug fixes / features)

PR Type

What kind of change does this PR introduce?

  • Bugfix
  • Feature (please, look at the "Scope of the project" section in the README.md file)
  • Code style update (formatting, local variables)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • CI related changes
  • Documentation content changes
  • Other... Please describe:

What is the current behavior?

#1671

What is the new behavior?

On Windows, passing command line args to node_binary is more consistent with Linux.

Does this PR introduce a breaking change?

  • Yes
  • No

Other information

@meteorcloudy
Copy link
Copy Markdown
Collaborator Author

I guess I need to add a test for this.

Copy link
Copy Markdown
Collaborator

@alexeagle alexeagle left a comment

Choose a reason for hiding this comment

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

Awesome thank you for the fix!!

Comment thread internal/common/test/print_cmd_args.js Outdated
* limitations under the License.
*/

const process = require('process')
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

nit: the process global variable is defined in a nodejs context without needing a require statement

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Done

for %%a in ("{bash_bin}") do set "bash_bin_dir=%%~dpa"
set PATH=%bash_bin_dir%;%PATH%
"{bash_bin}" -c "!run_script! %*"
set args=%*
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

would be nice to have some comments here to explain that this is escaping the arguments

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Cool, comments added.

@alexeagle alexeagle merged commit f9be953 into master Mar 6, 2020
@alexeagle alexeagle deleted the meteorcloudy-patch-2 branch March 6, 2020 11:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants