fix git clone

flattentree
filip mertens 11 months ago
parent 6e6313dd52
commit 3cd0e29e7c
  1. 14
      apps/remix-ide/src/app/files/dgitProvider.ts
  2. 11
      apps/remixdesktop/src/plugins/isoGitPlugin.ts

@ -425,9 +425,17 @@ class DGitProvider extends Plugin {
dir: folder,
input
}
const result = await this.call('isogit', 'clone', cmd)
this.call('fs', 'openWindow', folder)
return result
this.call('terminal', 'logHtml', `Cloning ${input.url}... please wait...`)
try{
const result = await this.call('isogit', 'clone', cmd)
this.call('fs', 'openWindow', folder)
return result
}catch(e){
this.call('notification', 'alert', {
id: 'dgitAlert',
message: 'Unexpected error while cloning the repository: \n' + e.toString(),
})
}
} else {
const permission = await this.askUserPermission('clone', 'Import multiple files into your workspaces.')
if (!permission) return false

@ -54,11 +54,12 @@ class IsoGitPluginClient extends ElectronBasePluginClient {
gitIsInstalled: boolean = false
constructor(webContentsId: number, profile: Profile) {
super(webContentsId, profile)
this.onload(() => {
this.onload(async () => {
this.on('fs' as any, 'workingDirChanged', async (path: string) => {
this.workingDir = path
this.gitIsInstalled = await gitProxy.version() ? true : false
})
this.gitIsInstalled = await gitProxy.version() ? true : false
})
}
@ -274,9 +275,13 @@ class IsoGitPluginClient extends ElectronBasePluginClient {
async clone(cmd: any) {
if (this.gitIsInstalled) {
await gitProxy.clone(cmd.url, cmd.dir)
if (this.gitIsInstalled) {
try{
await gitProxy.clone(cmd.url, cmd.dir)
}catch(e){
throw e
}
} else {
try {
const clone = await git.clone({

Loading…
Cancel
Save