updateSubmodules

pull/5370/head
Your Name 5 months ago
parent 729aeb664f
commit f6e86cdeb0
  1. 3
      apps/remix-ide/src/app/files/dgitProvider.ts
  2. 13
      apps/remixdesktop/src/plugins/isoGitPlugin.ts
  3. 10
      apps/remixdesktop/src/tools/git.ts

@ -541,6 +541,9 @@ class DGitProvider extends Plugin<any, CustomRemixApi> {
}
async updateSubmodules(input) {
if ((Registry.getInstance().get('platform').api.isDesktop())) {
return await this.call('isogit', 'updateSubmodules', null)
}
try {
const currentDir = (input && input.dir) || ''
const gitmodules = await this.parseGitmodules(currentDir)

@ -47,7 +47,7 @@ const clientProfile: Profile = {
name: 'isogit',
displayName: 'isogit',
description: 'isogit plugin',
methods: ['init', 'localStorageUsed', 'version', 'addremote', 'delremote', 'remotes', 'fetch', 'clone', 'export', 'import', 'status', 'log', 'commit', 'add', 'remove', 'rm', 'readblob', 'resolveref', 'branches', 'branch', 'checkout', 'currentbranch', 'push', 'pin', 'pull', 'pinList', 'unPin', 'setIpfsConfig', 'zip', 'setItem', 'getItem', 'openFolder', 'getCommitChanges', 'compareBranches', 'startClone']
methods: ['init', 'localStorageUsed', 'version', 'addremote', 'delremote', 'remotes', 'fetch', 'clone', 'export', 'import', 'status', 'log', 'commit', 'add', 'remove', 'rm', 'readblob', 'resolveref', 'branches', 'branch', 'checkout', 'currentbranch', 'push', 'pin', 'pull', 'pinList', 'unPin', 'setIpfsConfig', 'zip', 'setItem', 'getItem', 'openFolder', 'getCommitChanges', 'compareBranches', 'startClone', 'updateSubmodules']
}
class IsoGitPluginClient extends ElectronBasePluginClient {
@ -393,6 +393,17 @@ class IsoGitPluginClient extends ElectronBasePluginClient {
return await isoGit.compareBranches({ branch, remote }, await this.getGitConfig())
}
async updateSubmodules(input) {
if (this.gitIsInstalled) {
try {
return await gitProxy.updateSubmodules(this.workingDir)
} catch (e) {
throw e
}
} else {
this.call('terminal', 'log', { type: 'error', value: 'Please install git into your OS to use this functionality...' })
}
}
}

@ -97,6 +97,16 @@ export const gitProxy = {
await execAsync(`git init`, { cwd: path });
},
async updateSubmodules(path: string) {
const { stdout, stderr } = await execAsync(`git submodule update --init --recursive`, { cwd: path });
if (stdout) {
console.log('stdout:', stdout);
}
if (stderr) {
console.error('stderr:', stderr);
}
},
status: async (path: string) => {
const result = await execAsync('git status --porcelain -uall', { cwd: path })

Loading…
Cancel
Save