pull/4791/head
Your Name 6 months ago
parent db7ac5d068
commit 543beec2bf
  1. 7
      apps/remix-ide/src/app/files/dgitProvider.ts
  2. 8
      libs/remix-ui/git/src/lib/gitactions.ts

@ -88,7 +88,7 @@ class DGitProvider extends Plugin {
async addIsomorphicGitConfig(input) { async addIsomorphicGitConfig(input) {
const token = await this.call('config' as any, 'getAppParameter', 'settings/gist-access-token') const token = await this.call('config' as any, 'getAppParameter', 'settings/gist-access-token')
return { return {
corsProxy: 'https://corsproxy.remixproject.org/', //corsProxy: 'http://192.168.1.7:39049',
http, http,
onAuth: url => { onAuth: url => {
url url
@ -591,6 +591,7 @@ class DGitProvider extends Plugin {
...await this.addIsomorphicGitConfig(input), ...await this.addIsomorphicGitConfig(input),
...await this.addIsomorphicGitConfigFS() ...await this.addIsomorphicGitConfigFS()
} }
console.log(cmd)
this.call('terminal', 'logHtml', `Cloning ${input.url}...`) this.call('terminal', 'logHtml', `Cloning ${input.url}...`)
const result = await git.clone(cmd) const result = await git.clone(cmd)
if (!input.workspaceExists) { if (!input.workspaceExists) {
@ -740,7 +741,7 @@ class DGitProvider extends Plugin {
const cmd = { const cmd = {
force: input.force, force: input.force,
ref: input.ref.name, ref: input.ref.name,
remoteRef: input.remoteRef.name, remoteRef: input.remoteRef && input.remoteRef.name,
remote: input.remote.name, remote: input.remote.name,
author: await this.getCommandUser(input), author: await this.getCommandUser(input),
input, input,
@ -767,7 +768,7 @@ class DGitProvider extends Plugin {
async pull(input: pullInputType) { async pull(input: pullInputType) {
const cmd = { const cmd = {
ref: input.ref.name, ref: input.ref.name,
remoteRef: input.remoteRef.name, remoteRef: input.remoteRef && input.remoteRef.name,
author: await this.getCommandUser(input), author: await this.getCommandUser(input),
remote: input.remote.name, remote: input.remote.name,
input, input,

@ -294,16 +294,13 @@ export const checkout = async (cmd: checkoutInput) => {
export const clone = async (input: cloneInputType) => { export const clone = async (input: cloneInputType) => {
dispatch(setLoading(true)) dispatch(setLoading(true))
try {
await disableCallBacks()
// get last part of url
const urlParts = input.url.split("/"); const urlParts = input.url.split("/");
const lastPart = urlParts[urlParts.length - 1]; const lastPart = urlParts[urlParts.length - 1];
const repoName = lastPart.split(".")[0]; const repoName = lastPart.split(".")[0];
// add timestamp to repo name
const timestamp = new Date().getTime(); const timestamp = new Date().getTime();
const repoNameWithTimestamp = `${repoName}-${timestamp}`; const repoNameWithTimestamp = `${repoName}-${timestamp}`;
//const token = await tokenWarning(); try {
await disableCallBacks()
const token = await plugin.call('config' as any, 'getAppParameter' as any, 'settings/gist-access-token') const token = await plugin.call('config' as any, 'getAppParameter' as any, 'settings/gist-access-token')
await plugin.call('dgitApi', 'clone', { ...input, workspaceName: repoNameWithTimestamp }); await plugin.call('dgitApi', 'clone', { ...input, workspaceName: repoNameWithTimestamp });
@ -315,6 +312,7 @@ export const clone = async (input: cloneInputType) => {
}) })
//} //}
} catch (e: any) { } catch (e: any) {
//await plugin.call('filePanel', 'deleteWorkspace', repoNameWithTimestamp)
await parseError(e) await parseError(e)
} }
dispatch(setLoading(false)) dispatch(setLoading(false))

Loading…
Cancel
Save