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, dir: folder,
input input
} }
const result = await this.call('isogit', 'clone', cmd) this.call('terminal', 'logHtml', `Cloning ${input.url}... please wait...`)
this.call('fs', 'openWindow', folder) try{
return result 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 { } else {
const permission = await this.askUserPermission('clone', 'Import multiple files into your workspaces.') const permission = await this.askUserPermission('clone', 'Import multiple files into your workspaces.')
if (!permission) return false if (!permission) return false

@ -54,11 +54,12 @@ class IsoGitPluginClient extends ElectronBasePluginClient {
gitIsInstalled: boolean = false gitIsInstalled: boolean = false
constructor(webContentsId: number, profile: Profile) { constructor(webContentsId: number, profile: Profile) {
super(webContentsId, profile) super(webContentsId, profile)
this.onload(() => { this.onload(async () => {
this.on('fs' as any, 'workingDirChanged', async (path: string) => { this.on('fs' as any, 'workingDirChanged', async (path: string) => {
this.workingDir = path this.workingDir = path
this.gitIsInstalled = await gitProxy.version() ? true : false 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) { 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 { } else {
try { try {
const clone = await git.clone({ const clone = await git.clone({

Loading…
Cancel
Save