mirror of
https://github.com/Fabio286/antares.git
synced 2025-04-17 19:47:28 +02:00
refactor(Flatpak): temporarily disable import/export feature
This commit is contained in:
parent
05bd7672e1
commit
c3d96cb35b
3
.vscode/settings.json
vendored
3
.vscode/settings.json
vendored
@ -10,7 +10,8 @@
|
|||||||
"translation",
|
"translation",
|
||||||
"Linux",
|
"Linux",
|
||||||
"MacOS",
|
"MacOS",
|
||||||
"deps"
|
"deps",
|
||||||
|
"Flatpak"
|
||||||
],
|
],
|
||||||
"svg.preview.background": "transparent"
|
"svg.preview.background": "transparent"
|
||||||
}
|
}
|
@ -1,4 +1,4 @@
|
|||||||
import { ChildProcess, ChildProcessWithoutNullStreams, fork, spawn } from 'child_process';
|
import { ChildProcess, ChildProcessWithoutNullStreams, fork } from 'child_process';
|
||||||
import * as antares from 'common/interfaces/antares';
|
import * as antares from 'common/interfaces/antares';
|
||||||
import * as workers from 'common/interfaces/workers';
|
import * as workers from 'common/interfaces/workers';
|
||||||
import { dialog, ipcMain } from 'electron';
|
import { dialog, ipcMain } from 'electron';
|
||||||
@ -209,6 +209,11 @@ export default (connections: {[key: string]: antares.Client}) => {
|
|||||||
|
|
||||||
return new Promise((resolve/*, reject */) => {
|
return new Promise((resolve/*, reject */) => {
|
||||||
(async () => {
|
(async () => {
|
||||||
|
if (isFlatpak) {
|
||||||
|
resolve({ status: 'error', response: 'Temporarily unavailable on Flatpak' });
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (fs.existsSync(rest.outputFile)) { // If file exists ask for replace
|
if (fs.existsSync(rest.outputFile)) { // If file exists ask for replace
|
||||||
const result = await dialog.showMessageBox({
|
const result = await dialog.showMessageBox({
|
||||||
type: 'warning',
|
type: 'warning',
|
||||||
@ -229,18 +234,9 @@ export default (connections: {[key: string]: antares.Client}) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Init exporter process
|
// Init exporter process
|
||||||
if (isFlatpak) {
|
exporter = fork(isDevelopment ? './dist/exporter.js' : './exporter.js', [], {
|
||||||
const exporterPath = isDevelopment ? './dist/exporter.js' : path.resolve(__dirname, './exporter.js');
|
execArgv: isDevelopment ? ['--inspect=9224'] : undefined
|
||||||
|
});
|
||||||
exporter = spawn('flatpak-spawn', ['--host', 'node', exporterPath], {
|
|
||||||
stdio: ['inherit', 'inherit', 'inherit', 'ipc']
|
|
||||||
});
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
exporter = fork(isDevelopment ? './dist/exporter.js' : path.resolve(__dirname, './exporter.js'), [], {
|
|
||||||
execArgv: isDevelopment ? ['--inspect=9224'] : undefined
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
exporter.send({
|
exporter.send({
|
||||||
type: 'init',
|
type: 'init',
|
||||||
@ -319,21 +315,17 @@ export default (connections: {[key: string]: antares.Client}) => {
|
|||||||
|
|
||||||
return new Promise((resolve/*, reject */) => {
|
return new Promise((resolve/*, reject */) => {
|
||||||
(async () => {
|
(async () => {
|
||||||
|
if (isFlatpak) {
|
||||||
|
resolve({ status: 'warning', response: 'Temporarily unavailable on Flatpak' });
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
const dbConfig = await connections[options.uid].getDbConfig();
|
const dbConfig = await connections[options.uid].getDbConfig();
|
||||||
|
|
||||||
// Init importer process
|
// Init importer process
|
||||||
if (isFlatpak) {
|
importer = fork(isDevelopment ? './dist/importer.js' : path.resolve(__dirname, './importer.js'), [], {
|
||||||
const importerPath = isDevelopment ? './dist/importer.js' : path.resolve(__dirname, './importer.js');
|
execArgv: isDevelopment ? ['--inspect=9224'] : undefined
|
||||||
|
});
|
||||||
importer = spawn('flatpak-spawn', ['--host', 'node', importerPath], {
|
|
||||||
stdio: ['inherit', 'inherit', 'inherit', 'ipc']
|
|
||||||
});
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
importer = fork(isDevelopment ? './dist/importer.js' : path.resolve(__dirname, './importer.js'), [], {
|
|
||||||
execArgv: isDevelopment ? ['--inspect=9224'] : undefined
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
importer.send({
|
importer.send({
|
||||||
type: 'init',
|
type: 'init',
|
||||||
|
Loading…
x
Reference in New Issue
Block a user