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

Issue with multiline template strings #901

Closed
overengineered opened this issue Mar 10, 2024 · 2 comments
Closed

Issue with multiline template strings #901

overengineered opened this issue Mar 10, 2024 · 2 comments

Comments

@overengineered
Copy link

I found this example in documentation:

await $`npm run build
	--example-flag-one
	--example-flag-two`

I tried running:

await $({ verbose: true })`mkdir -p 
${"dir1"}`.pipeStdout?.(process.stdout);

Note the space after the -p. Execa verbose showed this as command:

[22:20:12.537] mkdir -p "
dir1"

On MacOS this actually created a folder with newline as the first name character. I tried

await $({ verbose: true })`mkdir -p \
${"dir1"}`.pipeStdout?.(process.stdout);

This created the expected folder simply named "dir1". I'm using version 8.0.1

@ehmicky
Copy link
Collaborator

ehmicky commented Mar 10, 2024

Hi @overengineered,

This feature has been implemented but has not been released yet. We're working on it, but it might take a few more weeks. Thanks for your interest in the feature!

In the meantime, you can use the following workaround:

await $`npm run build ${[
	'--example-flag-one',
	'--example-flag-two',
]}`

@ehmicky ehmicky closed this as completed Mar 10, 2024
@ehmicky
Copy link
Collaborator

ehmicky commented May 8, 2024

This feature has been just released in Execa 9.0.0. Please see (and share!) the release post and the changelog.

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

No branches or pull requests

2 participants