0

I'm trying to do a git clone with SSH, using simple-git in an electron app.

If I run in dev mode, everything goes well, and I can clone the repo, but when I build the application to a native mac osx app (*.app), I'm always getting an error saying:

GitError: fatal: not a git repository (or any of the parent directories): .git

But this message has no sense since I'm doing a git clone

The code that I'm executing is something like this (it works if I run dev):

simpleGit()
.env('GIT_SSH_COMMAND',ssh -o UserKnownHostsFile=miHostFile -o StrictHostKeyChecking=no -i my_secret_key`)
.clean(CleanOptions.FORCE)
.clone(
   `git@github.com:remote-repo.git`, 
   '.Users/user_name',
   ['-b', master,'--single-branch']
)

I'm wondering if this could be for a COORS problem or any other thing that I'm not allowed to do from an app

Boogie
  • 750
  • 7
  • 17
  • 1
    I have never used SimpleGit, but here's a total guess: `.clean` requires an existing repository in which to run `git clean`, so this fails if you don't have one already. `.clone` makes a new repository. Drop the `.clean` call and maybe it will Just Work. – torek Dec 08 '22 at 08:26
  • Thanks @torek, you were right it looks that using `.clean` is not working when I build the app – Boogie Dec 08 '22 at 12:36

0 Answers0