ashishb / wp2hugo

The best WordPress to static site migrator
https://ashishb.net/tech-thoughts/migrating-from-wordpress-to-hugo/
Other
228 stars 16 forks source link

Not working on Windows 10 #85

Open gamjaa opened 1 day ago

gamjaa commented 1 day ago

Hi. I'm running wp2hugo on windows 10, and I'm getting an error.

Here's the error message: image

10:24:19PM DBG main.go:68 > Output: /tmp
10:24:19PM DBG hugo_gen_setup.go:157 > Setting up Hugo site siteName=generated-2024-11-21-22-24-19
10:24:19PM DBG hugo_gen_setup.go:185 > Running Hugo setup command cmd="git version" step=1 totalSteps=7
10:24:21PM ERR hugo_gen_setup.go:192 > error running Hugo setup command error="exit status 1" cmd="git version" output=
10:24:21PM FTL main.go:43 > Error: error running Hugo setup command 'git version' -> exit status 1

I think this line is causing the problem.

https://github.com/ashishb/wp2hugo/blob/dae277fefc92efac0fa1d82ca086713834adf8bb/src/wp2hugo/internal/hugogenerator/hugo_gen_setup.go#L186

I checked and when I run bash -c on Windows, it runs through WSL(Windows Subsystem for Linux). So even if you already have git and hugo installed on Windows, it doesn't seem to work.

image

ashishb commented 18 hours ago

@gamjaa good catch. Any fixes that you have in mind? Can you test without bash -c? If it works then can you send a PR not to use it for Windows?