jayrambhia / Install-OpenCV

shell scripts to install different version of OpenCV in different distributions of Linux
1.04k stars 947 forks source link

script fails if parent directory has a space #55

Open lobit0 opened 8 years ago

lobit0 commented 8 years ago

I'm using Ubuntu 14.04.3 LTS (Edubuntu).

I cloned the repo into ~/Documents/Foo BAR/asdf/Install-OpenCV and ran the opencv_latest.sh script found on the Ubuntu directory.

It failed because it couldn't find some .hpp file (can't remember the name now and I'm very busy, sorry).

I found the script had put it into ~/Documents/Foo\ BAR/asdf/Install-OpenCV/somewhere/file.hpp

Note the Foo\ BAR instead of Foo BAR. There's obviously an escaping problem somewhere.

Then I copied the contents from Foo\ BAR into Foo BAR and ran the script again.

It failed because mkdir couldn't create the build directory (it already existed).

So my workaround was to clone the repo again into /tmp/Install-OpenCV, instead.

Would including an if statement before the mkdir one to check the directory doesn't already exist also make sense? I'm not sure.

Thanks for your efforts.