For some of my OCaml-made scripts, I would like to be able to express the following instruction :
Go to directory
mydir, and inside it do
git add myfile.
I tried the following in the toplevel :
Sys.chdir "mydir" ;; Sys.command "git add myfile" ;;
It doesn’t work (it’s a 128 Unix error code and says
fatal: pathspec myfile' did not match any files) even though the
.git does exist, the path is correct and if I do
cd mydir;git add myfile in the shell it works just fine.
Any ideas ?
If it matters, I’m using OCaml 4.11.0 on my 10.14.6 Mac