Closed AxelEriksson0 closed 4 days ago
I guess the issue lies in the cd
command not handling spaces unless the entire path is in strings. So perhaps $INIT_CWD
should return the path in strings.
That's a standard shell behaviour - variable interpolation splits content by spaces; that's why it's possible to pass arguments in variables (CFLAGS="-W -Wall"
). You need to explicitly wrap your variables around double quotes to disable this behaviour (cd "$DIR"
, not cd $DIR
).
@arcanis you're right. I tried doing that before but what I missed was escaping the quotes. I will close this issue.
(Yarn 4 works great and has definitely been a productivity boost)
Self-service
Describe the bug
Hello!
This is a bit of an edge case, as normally repositories and working directories don't contain spaces. But if you for example have a pipeline job in Jenkins and it creates a temporary folder based on the name of the job, it only picks up the name up to the first space when using
cd $INIT_CWD
.Maybe someone could pinpoint the issue, if not I could take a look at it as well.
To reproduce
I created a small repository that shows the issue - https://github.com/AxelEriksson0/directory-with-spaces-break-yarn-init_cwd
Environment
Additional context
No response