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 quotes to wrangler init names containing whitespaces before delegating to C3 #4211

Closed
wants to merge 1 commit into from

Conversation

dario-piotrowicz
Copy link
Member

fixes #3647

@dario-piotrowicz dario-piotrowicz requested a review from a team as a code owner October 18, 2023 08:52
@changeset-bot
Copy link

changeset-bot bot commented Oct 18, 2023

🦋 Changeset detected

Latest commit: eb4256a

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

This PR includes changesets to release 1 package
Name Type
wrangler 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

@github-actions
Copy link
Contributor

A wrangler prerelease is available for testing. You can install this latest build in your project with:

npm install --save-dev https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/6558518402/npm-package-wrangler-4211

You can reference the automatically updated head of this PR with:

npm install --save-dev https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/prs/6558518402/npm-package-wrangler-4211

Or you can use npx with this latest build directly:

npx https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/6558518402/npm-package-wrangler-4211 dev path/to/script.js
Additional artifacts:
npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/6558518402/npm-package-cloudflare-pages-shared-4211

Note that these links will no longer work once the GitHub Actions artifact expires.


wrangler@3.13.2 includes the following runtime dependencies:

Package Constraint Resolved
miniflare 3.20231016.0 3.20231016.0
workerd 1.20231016.0 1.20231016.0
workerd --version 1.20231016.0 2023-10-16

|

Please ensure constraints are pinned, and miniflare/workerd minor versions match.

@codecov
Copy link

codecov bot commented Oct 18, 2023

Codecov Report

Merging #4211 (eb4256a) into main (c2457cb) will increase coverage by 0.03%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #4211      +/-   ##
==========================================
+ Coverage   75.37%   75.41%   +0.03%     
==========================================
  Files         223      223              
  Lines       12217    12218       +1     
  Branches     3159     3160       +1     
==========================================
+ Hits         9209     9214       +5     
+ Misses       3008     3004       -4     
Files Coverage Δ
packages/wrangler/src/init.ts 92.03% <100.00%> (+0.01%) ⬆️

... and 3 files with indirect coverage changes

@petebacondarwin
Copy link
Contributor

Elsewhere in this monorepo @RamIdeas used shell-quote to get this behaviour. Is that worth considering?

@RamIdeas
Copy link
Contributor

RamIdeas commented Oct 18, 2023

We should indeed use wrangler/src/utils/shell-quote to quote the command for logging. The use of array args is correct here, so no need to use parse

In fact, this fix should only affect the logged command. Passing the name as an array (argv) element should be enough to escape the spaces. Adding quotes like in this PR, the logged command now looks correct but those quotes are going to be in the name arg when it gets to C3

I've just tried running npx wrangler@latest init "name with spaces" and it works as expected. I think the original issue needs to be verified

@dario-piotrowicz
Copy link
Member Author

As mentioned by @RamIdeas I think this change isn't really making a significant difference and that the issue needs to be investigated more in-depth, closing the PR, sorry about that 😅

@dario-piotrowicz dario-piotrowicz deleted the wrangler-init-string-params-fix branch October 18, 2023 10:36
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.

🐛 BUG: wrangler init fails when file path contains whitespace
3 participants