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

gp env - fails when value contains a space or newline #4736

Closed
shaal opened this issue Jul 8, 2021 · 1 comment · Fixed by #4816
Closed

gp env - fails when value contains a space or newline #4736

shaal opened this issue Jul 8, 2021 · 1 comment · Fixed by #4816
Assignees

Comments

@shaal
Copy link
Contributor

shaal commented Jul 8, 2021

Bug description

After the fix for #4493 was deployed to production, it introduced a new bug.
Now when the value contains space character, gp env fails.

Steps to reproduce

Open any Gitpod workspace.
In terminal, type:
gp env message="hello world"

empty string (correct format is key=value)

Compare it with a regular environment variable that doesn't have this issue:

  1. export message="hello world"
  2. echo $message
  3. Confirm the result is hello world

Expected behavior

gp env should allow the same values that Bash's export does.

Here's how I want to use it, but now it is broken :(

ssh-keygen -q -t rsa -b 4096 -f ~/.ssh/id_rsa
gp env MY_SSH_KEY=$(cat ~/.ssh/id_rsa)

Example repository

No response

Anything else?

No response

@ghuntley ghuntley added component: gp cli type: bug Something isn't working labels Jul 8, 2021
@shaal shaal changed the title gp env - fails when value contains a space gp env - fails when value contains a space or newline Jul 10, 2021
@shaal
Copy link
Contributor Author

shaal commented Jul 10, 2021

I ran some additional tests, trying to overcome the bug that doesn't allow spaces. When I figured out how to bypass spaces issues, I realized now gp env doesn't allow me to add newlines.

To clarify - this bug was introduced after #4494 was deployed. Before that, only = was causing a problem, spaces and newlines worked fine.

My repo (https://github.com/shaal/drupalpod) is broken because of this bug 😞
I use it for a one-time setup that saves data, and future workspace automatically reading that data using gp env.

I didn't discover the bug earlier because I didn't know that it was deployed (I could only track the PR that fixed it when it got merged to main)

I'd like to ask to test the PR that is going to fix this issue when it's ready.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants