Skip to content

Conversation

stopsopa
Copy link
Contributor

It brakes switching version of node through nvm in directories with space somewhere in it's path:
https://youtu.be/dW1cxfElF5U

I can't imagine why creator of this script is removing spaces from the path, maybe there is a reason for that but I don't know it, please review it then.

It breaks switching version of node through nvm in directories with space somewhere in it's path.
@ljharb
Copy link
Member

ljharb commented Jun 10, 2020

That was done in #1865; @d4nyll, any idea why that was added?

@d4nyll
Copy link
Contributor

d4nyll commented Jun 12, 2020

@ljharb IIRC, the tr -d '[:space:]' was because pwd prints a newline character at the end.

$ pwd
/home/d4nyll
$ pwd | wc
      1       1      13
$ pwd | tr -d '[:space:]'
/home/d4nyll$ pwd | tr -d '[:space:]' | wc
      0       1      12

If it's messing up with paths that contains spaces, it'll probably be better to remove the newline character on this line.

@ljharb
Copy link
Member

ljharb commented Jun 12, 2020

Seems reasonable to me. @stopsopa can you add that change?

@stopsopa
Copy link
Contributor Author

I've updated pull request to trim newline character from path

@stopsopa
Copy link
Contributor Author

Ekhm, It's ready to be reviewed again and possibly even merged.

@ljharb ljharb merged commit 2d4e877 into nvm-sh:master Jun 19, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants