|
|
@ -14,7 +14,7 @@ import JSZip from 'jszip' |
|
|
|
import path from 'path' |
|
|
|
import path from 'path' |
|
|
|
import FormData from 'form-data' |
|
|
|
import FormData from 'form-data' |
|
|
|
import axios from 'axios' |
|
|
|
import axios from 'axios' |
|
|
|
import isElectron from 'is-electron' |
|
|
|
import Registry from '../state/registry' |
|
|
|
|
|
|
|
|
|
|
|
const profile = { |
|
|
|
const profile = { |
|
|
|
name: 'dGitProvider', |
|
|
|
name: 'dGitProvider', |
|
|
@ -57,7 +57,7 @@ class DGitProvider extends Plugin { |
|
|
|
|
|
|
|
|
|
|
|
async getGitConfig() { |
|
|
|
async getGitConfig() { |
|
|
|
|
|
|
|
|
|
|
|
if (isElectron()) { |
|
|
|
if ((Registry.getInstance().get('platform').api.isDesktop())) { |
|
|
|
return { |
|
|
|
return { |
|
|
|
fs: window.remixFileSystem, |
|
|
|
fs: window.remixFileSystem, |
|
|
|
dir: '/' |
|
|
|
dir: '/' |
|
|
@ -89,7 +89,7 @@ class DGitProvider extends Plugin { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
async init(input?) { |
|
|
|
async init(input?) { |
|
|
|
if (isElectron()) { |
|
|
|
if ((Registry.getInstance().get('platform').api.isDesktop())) { |
|
|
|
await this.call('isogit', 'init', { |
|
|
|
await this.call('isogit', 'init', { |
|
|
|
defaultBranch: (input && input.branch) || 'main' |
|
|
|
defaultBranch: (input && input.branch) || 'main' |
|
|
|
}) |
|
|
|
}) |
|
|
@ -105,7 +105,7 @@ class DGitProvider extends Plugin { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
async version() { |
|
|
|
async version() { |
|
|
|
if (isElectron()) { |
|
|
|
if ((Registry.getInstance().get('platform').api.isDesktop())) { |
|
|
|
return await this.call('isogit', 'version') |
|
|
|
return await this.call('isogit', 'version') |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -115,7 +115,7 @@ class DGitProvider extends Plugin { |
|
|
|
|
|
|
|
|
|
|
|
async status(cmd) { |
|
|
|
async status(cmd) { |
|
|
|
|
|
|
|
|
|
|
|
if (isElectron()) { |
|
|
|
if ((Registry.getInstance().get('platform').api.isDesktop())) { |
|
|
|
const status = await this.call('isogit', 'status', cmd) |
|
|
|
const status = await this.call('isogit', 'status', cmd) |
|
|
|
|
|
|
|
|
|
|
|
return status |
|
|
|
return status |
|
|
@ -132,7 +132,7 @@ class DGitProvider extends Plugin { |
|
|
|
|
|
|
|
|
|
|
|
async add(cmd) { |
|
|
|
async add(cmd) { |
|
|
|
|
|
|
|
|
|
|
|
if (isElectron()) { |
|
|
|
if ((Registry.getInstance().get('platform').api.isDesktop())) { |
|
|
|
await this.call('isogit', 'add', cmd) |
|
|
|
await this.call('isogit', 'add', cmd) |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
await git.add({ |
|
|
|
await git.add({ |
|
|
@ -146,7 +146,7 @@ class DGitProvider extends Plugin { |
|
|
|
|
|
|
|
|
|
|
|
async rm(cmd) { |
|
|
|
async rm(cmd) { |
|
|
|
|
|
|
|
|
|
|
|
if (isElectron()) { |
|
|
|
if ((Registry.getInstance().get('platform').api.isDesktop())) { |
|
|
|
await this.call('isogit', 'rm', cmd) |
|
|
|
await this.call('isogit', 'rm', cmd) |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
await git.remove({ |
|
|
|
await git.remove({ |
|
|
@ -160,7 +160,7 @@ class DGitProvider extends Plugin { |
|
|
|
|
|
|
|
|
|
|
|
async reset(cmd) { |
|
|
|
async reset(cmd) { |
|
|
|
|
|
|
|
|
|
|
|
if (isElectron()) { |
|
|
|
if ((Registry.getInstance().get('platform').api.isDesktop())) { |
|
|
|
await this.call('isogit', 'reset', cmd) |
|
|
|
await this.call('isogit', 'reset', cmd) |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
await git.resetIndex({ |
|
|
|
await git.resetIndex({ |
|
|
@ -174,7 +174,7 @@ class DGitProvider extends Plugin { |
|
|
|
|
|
|
|
|
|
|
|
async checkout(cmd, refresh = true) { |
|
|
|
async checkout(cmd, refresh = true) { |
|
|
|
|
|
|
|
|
|
|
|
if (isElectron()) { |
|
|
|
if ((Registry.getInstance().get('platform').api.isDesktop())) { |
|
|
|
await this.call('isogit', 'checkout', cmd) |
|
|
|
await this.call('isogit', 'checkout', cmd) |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
await git.checkout({ |
|
|
|
await git.checkout({ |
|
|
@ -192,7 +192,7 @@ class DGitProvider extends Plugin { |
|
|
|
|
|
|
|
|
|
|
|
async log(cmd) { |
|
|
|
async log(cmd) { |
|
|
|
|
|
|
|
|
|
|
|
if (isElectron()) { |
|
|
|
if ((Registry.getInstance().get('platform').api.isDesktop())) { |
|
|
|
const status = await this.call('isogit', 'log', { |
|
|
|
const status = await this.call('isogit', 'log', { |
|
|
|
...cmd, |
|
|
|
...cmd, |
|
|
|
depth: 10 |
|
|
|
depth: 10 |
|
|
@ -211,7 +211,7 @@ class DGitProvider extends Plugin { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
async remotes(config) { |
|
|
|
async remotes(config) { |
|
|
|
if (isElectron()) { |
|
|
|
if ((Registry.getInstance().get('platform').api.isDesktop())) { |
|
|
|
return await this.call('isogit', 'remotes', config) |
|
|
|
return await this.call('isogit', 'remotes', config) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -227,7 +227,7 @@ class DGitProvider extends Plugin { |
|
|
|
async branch(cmd, refresh = true) { |
|
|
|
async branch(cmd, refresh = true) { |
|
|
|
|
|
|
|
|
|
|
|
let status |
|
|
|
let status |
|
|
|
if (isElectron()) { |
|
|
|
if ((Registry.getInstance().get('platform').api.isDesktop())) { |
|
|
|
status = await this.call('isogit', 'branch', cmd) |
|
|
|
status = await this.call('isogit', 'branch', cmd) |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
status = await git.branch({ |
|
|
|
status = await git.branch({ |
|
|
@ -248,7 +248,7 @@ class DGitProvider extends Plugin { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (isElectron()) { |
|
|
|
if ((Registry.getInstance().get('platform').api.isDesktop())) { |
|
|
|
return await this.call('isogit', 'currentbranch') |
|
|
|
return await this.call('isogit', 'currentbranch') |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -265,7 +265,7 @@ class DGitProvider extends Plugin { |
|
|
|
|
|
|
|
|
|
|
|
async branches(config) { |
|
|
|
async branches(config) { |
|
|
|
|
|
|
|
|
|
|
|
if (isElectron()) { |
|
|
|
if ((Registry.getInstance().get('platform').api.isDesktop())) { |
|
|
|
return await this.call('isogit', 'branches') |
|
|
|
return await this.call('isogit', 'branches') |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -288,7 +288,7 @@ class DGitProvider extends Plugin { |
|
|
|
|
|
|
|
|
|
|
|
async commit(cmd) { |
|
|
|
async commit(cmd) { |
|
|
|
|
|
|
|
|
|
|
|
if (isElectron()) { |
|
|
|
if ((Registry.getInstance().get('platform').api.isDesktop())) { |
|
|
|
try { |
|
|
|
try { |
|
|
|
await this.call('isogit', 'init') |
|
|
|
await this.call('isogit', 'init') |
|
|
|
const sha = await this.call('isogit', 'commit', cmd) |
|
|
|
const sha = await this.call('isogit', 'commit', cmd) |
|
|
@ -315,7 +315,7 @@ class DGitProvider extends Plugin { |
|
|
|
|
|
|
|
|
|
|
|
async lsfiles(cmd) { |
|
|
|
async lsfiles(cmd) { |
|
|
|
|
|
|
|
|
|
|
|
if (isElectron()) { |
|
|
|
if ((Registry.getInstance().get('platform').api.isDesktop())) { |
|
|
|
return await this.call('isogit', 'lsfiles', cmd) |
|
|
|
return await this.call('isogit', 'lsfiles', cmd) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -328,7 +328,7 @@ class DGitProvider extends Plugin { |
|
|
|
|
|
|
|
|
|
|
|
async resolveref(cmd) { |
|
|
|
async resolveref(cmd) { |
|
|
|
|
|
|
|
|
|
|
|
if (isElectron()) { |
|
|
|
if ((Registry.getInstance().get('platform').api.isDesktop())) { |
|
|
|
return await this.call('isogit', 'resolveref', cmd) |
|
|
|
return await this.call('isogit', 'resolveref', cmd) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -340,7 +340,7 @@ class DGitProvider extends Plugin { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
async readblob(cmd) { |
|
|
|
async readblob(cmd) { |
|
|
|
if (isElectron()) { |
|
|
|
if ((Registry.getInstance().get('platform').api.isDesktop())) { |
|
|
|
const readBlobResult = await this.call('isogit', 'readblob', cmd) |
|
|
|
const readBlobResult = await this.call('isogit', 'readblob', cmd) |
|
|
|
return readBlobResult |
|
|
|
return readBlobResult |
|
|
|
} |
|
|
|
} |
|
|
@ -370,7 +370,7 @@ class DGitProvider extends Plugin { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
async addremote(input) { |
|
|
|
async addremote(input) { |
|
|
|
if (isElectron()) { |
|
|
|
if ((Registry.getInstance().get('platform').api.isDesktop())) { |
|
|
|
await this.call('isogit', 'addremote', { url: input.url, remote: input.remote }) |
|
|
|
await this.call('isogit', 'addremote', { url: input.url, remote: input.remote }) |
|
|
|
return |
|
|
|
return |
|
|
|
} |
|
|
|
} |
|
|
@ -378,7 +378,7 @@ class DGitProvider extends Plugin { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
async delremote(input) { |
|
|
|
async delremote(input) { |
|
|
|
if (isElectron()) { |
|
|
|
if ((Registry.getInstance().get('platform').api.isDesktop())) { |
|
|
|
await this.call('isogit', 'delremote', { remote: input.remote }) |
|
|
|
await this.call('isogit', 'delremote', { remote: input.remote }) |
|
|
|
return |
|
|
|
return |
|
|
|
} |
|
|
|
} |
|
|
@ -391,7 +391,7 @@ class DGitProvider extends Plugin { |
|
|
|
|
|
|
|
|
|
|
|
async clone(input, workspaceName, workspaceExists = false) { |
|
|
|
async clone(input, workspaceName, workspaceExists = false) { |
|
|
|
|
|
|
|
|
|
|
|
if (isElectron()) { |
|
|
|
if ((Registry.getInstance().get('platform').api.isDesktop())) { |
|
|
|
const folder = await this.call('fs', 'selectFolder') |
|
|
|
const folder = await this.call('fs', 'selectFolder') |
|
|
|
if (!folder) return false |
|
|
|
if (!folder) return false |
|
|
|
const cmd = { |
|
|
|
const cmd = { |
|
|
@ -442,7 +442,7 @@ class DGitProvider extends Plugin { |
|
|
|
}, |
|
|
|
}, |
|
|
|
input, |
|
|
|
input, |
|
|
|
} |
|
|
|
} |
|
|
|
if (isElectron()) { |
|
|
|
if ((Registry.getInstance().get('platform').api.isDesktop())) { |
|
|
|
return await this.call('isogit', 'push', cmd) |
|
|
|
return await this.call('isogit', 'push', cmd) |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
|
|
|
|
|
|
|
@ -470,7 +470,7 @@ class DGitProvider extends Plugin { |
|
|
|
input, |
|
|
|
input, |
|
|
|
} |
|
|
|
} |
|
|
|
let result |
|
|
|
let result |
|
|
|
if (isElectron()) { |
|
|
|
if ((Registry.getInstance().get('platform').api.isDesktop())) { |
|
|
|
result = await this.call('isogit', 'pull', cmd) |
|
|
|
result = await this.call('isogit', 'pull', cmd) |
|
|
|
} |
|
|
|
} |
|
|
|
else { |
|
|
|
else { |
|
|
@ -501,7 +501,7 @@ class DGitProvider extends Plugin { |
|
|
|
input |
|
|
|
input |
|
|
|
} |
|
|
|
} |
|
|
|
let result |
|
|
|
let result |
|
|
|
if (isElectron()) { |
|
|
|
if ((Registry.getInstance().get('platform').api.isDesktop())) { |
|
|
|
result = await this.call('isogit', 'fetch', cmd) |
|
|
|
result = await this.call('isogit', 'fetch', cmd) |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
const cmd2 = { |
|
|
|
const cmd2 = { |
|
|
|