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

devenv: escape shell vars in task exports #1477

Merged
merged 1 commit into from
Sep 26, 2024
Merged

devenv: escape shell vars in task exports #1477

merged 1 commit into from
Sep 26, 2024

Conversation

sandydoo
Copy link
Member

Fixes sourcing exported variables with spaces in them. Hello, macOS.

Fixes sourcing exported variables with spaces in them. Hello, macOS.
@sandydoo sandydoo added bug Something isn't working cli Related to the devenv CLI labels Sep 26, 2024
Copy link

Deploying devenv with  Cloudflare Pages  Cloudflare Pages

Latest commit: f2e17c6
Status:🚫  Build failed.

View logs

@@ -836,6 +840,21 @@ impl TasksUi {
}
}

/// Escape a shell variable by wrapping it in single quotes.
/// Any single quotes within the variable are escaped.
fn shell_escape(s: &str) -> String {
Copy link
Member

Choose a reason for hiding this comment

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

I wonder if we should instead use some library like https://docs.rs/shell-quote/latest/shell_quote/ not to maintain this code which is tricky to get right

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah, maybe. The above is what nix develop does, which felt like a safe choice without getting into the weeds.

@domenkozar domenkozar merged commit 32ccab4 into main Sep 26, 2024
258 of 269 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working cli Related to the devenv CLI
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants