fix submodule

pull/4791/head
Your Name 5 months ago
parent 5781a0cae4
commit c0497fbd4d
  1. 20
      apps/remix-ide/src/app/files/dgitProvider.ts

@ -22,6 +22,7 @@ import { IndexedDBStorage } from './filesystems/indexedDB'
import { GitHubUser, branch, commitChange, remote, pagedCommits, remoteCommitsInputType, cloneInputType, fetchInputType, pullInputType, pushInputType, currentBranchInput, branchInputType, addInput, rmInput, resolveRefInput, readBlobInput, repositoriesInput, commitInput, branchDifference, compareBranchesInput, initInput, userEmails, checkoutInput } from '@remix-ui/git'
import { LibraryProfile, StatusEvents } from '@remixproject/plugin-utils'
import { ITerminal } from '@remixproject/plugin-api/src/lib/terminal'
import { partial } from 'lodash'
declare global {
interface Window { remixFileSystemCallback: IndexedDBStorage; remixFileSystem: any; }
@ -86,6 +87,7 @@ class DGitProvider extends Plugin {
}
async addIsomorphicGitConfig(input) {
const token = await this.call('config' as any, 'getAppParameter', 'settings/gist-access-token')
let config = {
@ -120,6 +122,14 @@ class DGitProvider extends Plugin {
}
}
}
if(input.provider && input.provider === 'github') {
config = {
...config,
corsProxy: 'https://corsproxy.remixproject.org/',
}
}
return config
}
@ -685,7 +695,10 @@ class DGitProvider extends Plugin {
url: module.url,
singleBranch: true,
depth: 1,
...await this.addIsomorphicGitConfig(input),
...await this.addIsomorphicGitConfig({
...input,
provider: 'github'
}),
...await this.addIsomorphicGitConfigFS(dir)
}
this.call('terminal', 'logHtml', `Cloning submodule ${dir}...`)
@ -709,7 +722,10 @@ class DGitProvider extends Plugin {
if (result && result.length) {
this.call('terminal', 'logHtml', `Checking out submodule ${dir} to ${result[0]} in directory ${dir}`)
await git.fetch({
...await this.addIsomorphicGitConfig(input),
...await this.addIsomorphicGitConfig({
...input,
provider: 'github'
}),
...await this.addIsomorphicGitConfigFS(dir),
singleBranch: true,
ref: result[0]

Loading…
Cancel
Save