From 543beec2bf55d20b6a2f8ffa8532817f57d1f5bd Mon Sep 17 00:00:00 2001 From: Your Name Date: Sun, 9 Jun 2024 06:55:53 +0200 Subject: [PATCH] bugs --- apps/remix-ide/src/app/files/dgitProvider.ts | 7 ++++--- libs/remix-ui/git/src/lib/gitactions.ts | 14 ++++++-------- 2 files changed, 10 insertions(+), 11 deletions(-) diff --git a/apps/remix-ide/src/app/files/dgitProvider.ts b/apps/remix-ide/src/app/files/dgitProvider.ts index 6fe5c5c1ee..0039094fbf 100644 --- a/apps/remix-ide/src/app/files/dgitProvider.ts +++ b/apps/remix-ide/src/app/files/dgitProvider.ts @@ -88,7 +88,7 @@ class DGitProvider extends Plugin { async addIsomorphicGitConfig(input) { const token = await this.call('config' as any, 'getAppParameter', 'settings/gist-access-token') return { - corsProxy: 'https://corsproxy.remixproject.org/', + //corsProxy: 'http://192.168.1.7:39049', http, onAuth: url => { url @@ -591,6 +591,7 @@ class DGitProvider extends Plugin { ...await this.addIsomorphicGitConfig(input), ...await this.addIsomorphicGitConfigFS() } + console.log(cmd) this.call('terminal', 'logHtml', `Cloning ${input.url}...`) const result = await git.clone(cmd) if (!input.workspaceExists) { @@ -740,7 +741,7 @@ class DGitProvider extends Plugin { const cmd = { force: input.force, ref: input.ref.name, - remoteRef: input.remoteRef.name, + remoteRef: input.remoteRef && input.remoteRef.name, remote: input.remote.name, author: await this.getCommandUser(input), input, @@ -767,7 +768,7 @@ class DGitProvider extends Plugin { async pull(input: pullInputType) { const cmd = { ref: input.ref.name, - remoteRef: input.remoteRef.name, + remoteRef: input.remoteRef && input.remoteRef.name, author: await this.getCommandUser(input), remote: input.remote.name, input, diff --git a/libs/remix-ui/git/src/lib/gitactions.ts b/libs/remix-ui/git/src/lib/gitactions.ts index f1904758ef..599c9bedab 100644 --- a/libs/remix-ui/git/src/lib/gitactions.ts +++ b/libs/remix-ui/git/src/lib/gitactions.ts @@ -294,16 +294,13 @@ export const checkout = async (cmd: checkoutInput) => { export const clone = async (input: cloneInputType) => { dispatch(setLoading(true)) + const urlParts = input.url.split("/"); + const lastPart = urlParts[urlParts.length - 1]; + const repoName = lastPart.split(".")[0]; + const timestamp = new Date().getTime(); + const repoNameWithTimestamp = `${repoName}-${timestamp}`; try { await disableCallBacks() - // get last part of url - const urlParts = input.url.split("/"); - const lastPart = urlParts[urlParts.length - 1]; - const repoName = lastPart.split(".")[0]; - // add timestamp to repo name - const timestamp = new Date().getTime(); - const repoNameWithTimestamp = `${repoName}-${timestamp}`; - //const token = await tokenWarning(); const token = await plugin.call('config' as any, 'getAppParameter' as any, 'settings/gist-access-token') await plugin.call('dgitApi', 'clone', { ...input, workspaceName: repoNameWithTimestamp }); @@ -315,6 +312,7 @@ export const clone = async (input: cloneInputType) => { }) //} } catch (e: any) { + //await plugin.call('filePanel', 'deleteWorkspace', repoNameWithTimestamp) await parseError(e) } dispatch(setLoading(false))