|
|
@ -46,11 +46,11 @@ 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', '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 { |
|
|
|
workingDir: string = '/Volumes/bunsen/code/empty/' |
|
|
|
workingDir: string = '' |
|
|
|
gitIsInstalled: boolean = false |
|
|
|
gitIsInstalled: boolean = false |
|
|
|
constructor(webContentsId: number, profile: Profile) { |
|
|
|
constructor(webContentsId: number, profile: Profile) { |
|
|
|
super(webContentsId, profile) |
|
|
|
super(webContentsId, profile) |
|
|
@ -81,6 +81,10 @@ class IsoGitPluginClient extends ElectronBasePluginClient { |
|
|
|
async status(cmd: any) { |
|
|
|
async status(cmd: any) { |
|
|
|
console.log('status', cmd) |
|
|
|
console.log('status', cmd) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if(this.workingDir === ''){ |
|
|
|
|
|
|
|
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 |
|
|
@ -104,6 +108,10 @@ class IsoGitPluginClient extends ElectronBasePluginClient { |
|
|
|
} |
|
|
|
} |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if(this.workingDir === ''){ |
|
|
|
|
|
|
|
return [] |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
console.log('log') |
|
|
|
console.log('log') |
|
|
|
const log = await git.log({ |
|
|
|
const log = await git.log({ |
|
|
|
...await this.getGitConfig(), |
|
|
|
...await this.getGitConfig(), |
|
|
@ -133,6 +141,17 @@ class IsoGitPluginClient extends ElectronBasePluginClient { |
|
|
|
return rm |
|
|
|
return rm |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
async reset(cmd: any){ |
|
|
|
|
|
|
|
console.log('reset', cmd) |
|
|
|
|
|
|
|
const reset = await git.resetIndex({ |
|
|
|
|
|
|
|
...await this.getGitConfig(), |
|
|
|
|
|
|
|
...cmd |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
console.log('RESET', reset) |
|
|
|
|
|
|
|
return reset |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
async commit(cmd: any) { |
|
|
|
async commit(cmd: any) { |
|
|
|
console.log('commit') |
|
|
|
console.log('commit') |
|
|
|
const commit = await git.commit({ |
|
|
|
const commit = await git.commit({ |
|
|
|