vala-lang / valdo

Create new Vala projects from templates
GNU Lesser General Public License v2.1
49 stars 13 forks source link

Make git repo creation optional #15

Closed pervoj closed 2 years ago

pervoj commented 2 years ago

I added the functionality for #13.

Prince781 commented 2 years ago

perhaps a better approach would be to test for git in our PATH before deciding to set up a repo?

pervoj commented 2 years ago

Maybe so, but I think this is sufficient.

When running as a Flatpak, the application could not find Git.

Prince781 commented 2 years ago

But a flatpak might be in an environment where it does have access to git, no? I think if a flatpak depended on an SDK that included that it would work. So shouldn't we be a little more flexible here?

pervoj commented 2 years ago

I've been looking for ways to give an application running via Flatpak access to git, and the only way seems to be packing git in a Flatpak package, but it doesn't seem like the best solution, since I only need the repository creation feature.

The second option is to create the .git directory manually from code. This option seems better to me. Therefore, I would need to be able to turn off the git init call so that an error message is not displayed.

Prince781 commented 2 years ago

The second option is to create the .git directory manually from code.

Well this wouldn't work. It's not just the .git directory, but the database that git creates you'd need to create on your own.

There should be some way to test whether git is in path and then avoid this code. I think GLib has such a utility.

pervoj commented 2 years ago

It should be better now.

Sorry for the late reply, I was quite busy lately.

Prince781 commented 2 years ago

Done. Thanks for your contribution. :)