pedroborges / kirby-autogit

⬢ Saves every change made via Kirby Panel to a Git repository
149 stars 23 forks source link

The system cannot find the path specified. #52

Closed kwaimind closed 4 years ago

kwaimind commented 5 years ago

Hey there 👋 ,

I've installed the plugin but when I click any of the widget buttons, I get the following error:

The system cannot find the path specified.

I can't seem to find a fix and have followed the fix for issue #3 (https://github.com/pedroborges/kirby-autogit/issues/3#issuecomment-233907451)

Any help would be amazing.

Using the default settings from the README.md, and my project has git setup with remote-url enabled with the names "heroku" and "origin".

hdodov commented 5 years ago

I was able to fix that by changing /vendor/sebastian/git/src/Git.php at line 131 from:

$command = 'cd ' . escapeshellarg($this->repositoryPath) . '; git ' . $command . ' 2>&1';

to:

$command = 'cd ' . escapeshellarg($this->repositoryPath) . ' && git ' . $command . ' 2>&1';

When I run this in the console:

cd "C:\path\to\content"; git --version 2>&1

I indeed get this error:

The system cannot find the path specified.

but changing ; to &&:

cd "C:\path\to\content" && git --version 2>&1

Runs correctly and outputs:

git version 2.18.0.windows.1

So apparently you should concatenate commands with && instead of ;, at least on Windows.