I am using mob.sh on windows inside a project with a space in the project path on disk. When I run mob start, instead of opening the last modified file in my current IDEA Window, a new IDEA window opens up.
Context Info:
MOB_OPEN_COMMAND="idea %s" and works fine when removing the space in the project path.
I am on a windows machine
The path in my case is "C:/_Development/github/LH-MobSh Kata"
What happens:
When I run mob start (with last modified file "test.txt"), a new IDEA window opens with two files open:
"LH-MobSh" in "..._Development\github"
"test.txt" in "...\LH-MobSh Kata\Kata"
The log of mob start --debug contains the following lines:
DEBUG Try to open last modified file
DEBUG Running command <git log -1 --pretty=format:%B> in silent mode, capturing combined output
DEBUG mob next [ci-skip] [ci skip] [skip ci]
DEBUG
DEBUG lastFile:test.txt
DEBUG Running command <git log -1 --pretty=format:%B> in silent mode, capturing combined output
DEBUG mob next [ci-skip] [ci skip] [skip ci]
DEBUG
DEBUG lastFile:test.txt
DEBUG Running command <git rev-parse --show-toplevel> in silent mode, capturing combined output
DEBUG C:/_Development/github/LH-MobSh Kata
DEBUG Starting command idea C:/_Development/github/LH-MobSh Kata/test.txt
DEBUG Open last modified file: C:/_Development/github/LH-MobSh Kata/test.txt
What should happen:
Preferrably, the space in the path should be handled correctly and the last modified file should be opened in my current IDEA window.
If that's too hard to accomplish, I would hope to see an error message explaining that spaces in the project path (and last modified file names) are not supported. In this case, it would be nice to abort opening the last modified file.
Preliminary Analysis:
The main problem seems to be split := strings.Split(injectCommandWithMessage(c.OpenCommand, filepath), " ") in func openCommandFor(c config.Configuration, filepath string) (string, []string). This strings.Split operation results in the filepath being split into multiple args.
If you are interested, I could share my attempt on opening the last modified file despite spaces in the project path. It works on my machine and comes with a new test. I will go through the contributing workflow in the next few days, if you are interested.
I am using mob.sh on windows inside a project with a space in the project path on disk. When I run
mob start
, instead of opening the last modified file in my current IDEA Window, a new IDEA window opens up.Context Info:
What happens:
When I run
mob start
(with last modified file "test.txt"), a new IDEA window opens with two files open:The log of
mob start --debug
contains the following lines:What should happen: Preferrably, the space in the path should be handled correctly and the last modified file should be opened in my current IDEA window. If that's too hard to accomplish, I would hope to see an error message explaining that spaces in the project path (and last modified file names) are not supported. In this case, it would be nice to abort opening the last modified file.
Preliminary Analysis: The main problem seems to be
split := strings.Split(injectCommandWithMessage(c.OpenCommand, filepath), " ")
infunc openCommandFor(c config.Configuration, filepath string) (string, []string)
. This strings.Split operation results in the filepath being split into multiple args. If you are interested, I could share my attempt on opening the last modified file despite spaces in the project path. It works on my machine and comes with a new test. I will go through the contributing workflow in the next few days, if you are interested.