|
|
@ -46,7 +46,7 @@ const clientProfile: Profile = { |
|
|
|
name: 'isogit', |
|
|
|
name: 'isogit', |
|
|
|
displayName: 'isogit', |
|
|
|
displayName: 'isogit', |
|
|
|
description: 'isogit plugin', |
|
|
|
description: 'isogit plugin', |
|
|
|
methods: ['init', 'localStorageUsed', 'version', 'addremote', 'delremote', 'remotes', 'fetch', 'clone', 'export', 'import', 'status', 'log', 'commit', 'add', 'remove', 'reset', 'rm', 'lsfiles', 'readblob', 'resolveref', 'branches', 'branch', 'checkout', 'currentbranch', 'push', 'pin', 'pull', 'pinList', 'unPin', 'setIpfsConfig', 'zip', 'setItem', 'getItem', 'openFolder'] |
|
|
|
methods: ['init', 'localStorageUsed', 'version', 'addremote', 'delremote', 'remotes', 'fetch', 'clone', 'export', 'import', 'status', 'log', 'commit', 'add', 'remove', 'reset', 'rm', 'lsfiles', 'readblob', 'resolveref', 'branches', 'branch', 'checkout', 'currentbranch', 'push', 'pin', 'pull', 'pinList', 'unPin', 'setIpfsConfig', 'zip', 'setItem', 'getItem', 'openFolder'] |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
class IsoGitPluginClient extends ElectronBasePluginClient { |
|
|
|
class IsoGitPluginClient extends ElectronBasePluginClient { |
|
|
@ -76,11 +76,11 @@ class IsoGitPluginClient extends ElectronBasePluginClient { |
|
|
|
async status(cmd: any) { |
|
|
|
async status(cmd: any) { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if(this.workingDir === ''){ |
|
|
|
if (this.workingDir === '') { |
|
|
|
return [] |
|
|
|
return [] |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if(this.gitIsInstalled){ |
|
|
|
if (this.gitIsInstalled) { |
|
|
|
const status = await gitProxy.status(this.workingDir) |
|
|
|
const status = await gitProxy.status(this.workingDir) |
|
|
|
return status |
|
|
|
return status |
|
|
|
} |
|
|
|
} |
|
|
@ -103,7 +103,7 @@ class IsoGitPluginClient extends ElectronBasePluginClient { |
|
|
|
} |
|
|
|
} |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
|
|
|
|
|
|
|
|
if(this.workingDir === ''){ |
|
|
|
if (this.workingDir === '') { |
|
|
|
return [] |
|
|
|
return [] |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -134,7 +134,7 @@ class IsoGitPluginClient extends ElectronBasePluginClient { |
|
|
|
return rm |
|
|
|
return rm |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
async reset(cmd: any){ |
|
|
|
async reset(cmd: any) { |
|
|
|
|
|
|
|
|
|
|
|
const reset = await git.resetIndex({ |
|
|
|
const reset = await git.resetIndex({ |
|
|
|
...await this.getGitConfig(), |
|
|
|
...await this.getGitConfig(), |
|
|
@ -143,7 +143,7 @@ class IsoGitPluginClient extends ElectronBasePluginClient { |
|
|
|
|
|
|
|
|
|
|
|
return reset |
|
|
|
return reset |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
async commit(cmd: any) { |
|
|
|
async commit(cmd: any) { |
|
|
|
|
|
|
|
|
|
|
@ -173,7 +173,7 @@ class IsoGitPluginClient extends ElectronBasePluginClient { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
async lsfiles(cmd: any) { |
|
|
|
async lsfiles(cmd: any) { |
|
|
|
|
|
|
|
|
|
|
|
const lsfiles = await git.listFiles({ |
|
|
|
const lsfiles = await git.listFiles({ |
|
|
|
...await this.getGitConfig(), |
|
|
|
...await this.getGitConfig(), |
|
|
|
...cmd |
|
|
|
...cmd |
|
|
@ -214,37 +214,56 @@ class IsoGitPluginClient extends ElectronBasePluginClient { |
|
|
|
|
|
|
|
|
|
|
|
async push(cmd: any) { |
|
|
|
async push(cmd: any) { |
|
|
|
|
|
|
|
|
|
|
|
console.log('PUSH', cmd) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const push = await git.push({ |
|
|
|
|
|
|
|
...await this.getGitConfig(), |
|
|
|
|
|
|
|
...cmd, |
|
|
|
|
|
|
|
...parseInput(cmd.input) |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return push |
|
|
|
if (this.gitIsInstalled) { |
|
|
|
|
|
|
|
await gitProxy.push(this.workingDir, cmd.remote, cmd.ref, cmd.remoteRef, cmd.force) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const push = await git.push({ |
|
|
|
|
|
|
|
...await this.getGitConfig(), |
|
|
|
|
|
|
|
...cmd, |
|
|
|
|
|
|
|
...parseInput(cmd.input) |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
return push |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
async pull(cmd: any) { |
|
|
|
async pull(cmd: any) { |
|
|
|
|
|
|
|
|
|
|
|
const pull = await git.pull({ |
|
|
|
if (this.gitIsInstalled) { |
|
|
|
...await this.getGitConfig(), |
|
|
|
await gitProxy.pull(this.workingDir, cmd.remote, cmd.ref, cmd.remoteRef) |
|
|
|
...cmd, |
|
|
|
|
|
|
|
...parseInput(cmd.input) |
|
|
|
} else { |
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
const pull = await git.pull({ |
|
|
|
|
|
|
|
...await this.getGitConfig(), |
|
|
|
|
|
|
|
...cmd, |
|
|
|
|
|
|
|
...parseInput(cmd.input) |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return pull |
|
|
|
|
|
|
|
|
|
|
|
return pull |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
async fetch(cmd: any) { |
|
|
|
async fetch(cmd: any) { |
|
|
|
|
|
|
|
|
|
|
|
const fetch = await git.fetch({ |
|
|
|
if (this.gitIsInstalled) { |
|
|
|
...await this.getGitConfig(), |
|
|
|
await gitProxy.fetch(this.workingDir, cmd.remote, cmd.remoteRef) |
|
|
|
...cmd, |
|
|
|
|
|
|
|
...parseInput(cmd.input) |
|
|
|
} else { |
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return fetch |
|
|
|
const fetch = await git.fetch({ |
|
|
|
|
|
|
|
...await this.getGitConfig(), |
|
|
|
|
|
|
|
...cmd, |
|
|
|
|
|
|
|
...parseInput(cmd.input) |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return fetch |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
async clone(cmd: any) { |
|
|
|
async clone(cmd: any) { |
|
|
|