mirror of https://github.com/embarklabs/embark.git
move storage processes to their own modules
This commit is contained in:
parent
a1fa4ed30d
commit
d7340b4f5a
|
@ -2,7 +2,8 @@ const UploadIPFS = require('./upload.js');
|
||||||
const utils = require('../../utils/utils.js');
|
const utils = require('../../utils/utils.js');
|
||||||
const fs = require('../../core/fs.js');
|
const fs = require('../../core/fs.js');
|
||||||
const IpfsApi = require('ipfs-api');
|
const IpfsApi = require('ipfs-api');
|
||||||
const StorageProcessesLauncher = require('../../processes/storageProcesses/storageProcessesLauncher');
|
// TODO: not great, breaks module isolation
|
||||||
|
const StorageProcessesLauncher = require('../storage/storageProcessesLauncher');
|
||||||
|
|
||||||
class IPFS {
|
class IPFS {
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
const child_process = require('child_process');
|
const child_process = require('child_process');
|
||||||
const ProcessWrapper = require('../processWrapper');
|
const ProcessWrapper = require('../../processes/processWrapper');
|
||||||
const constants = require('../../constants');
|
const constants = require('../../constants');
|
||||||
|
|
||||||
let ipfsProcess; // eslint-disable-line no-unused-vars
|
let ipfsProcess; // eslint-disable-line no-unused-vars
|
|
@ -1,7 +1,7 @@
|
||||||
const fs = require('../../core/fs');
|
const fs = require('../../core/fs');
|
||||||
const shellJs = require('shelljs');
|
const shellJs = require('shelljs');
|
||||||
const utils = require('../../utils/utils');
|
const utils = require('../../utils/utils');
|
||||||
const ProcessLauncher = require('../processLauncher');
|
const ProcessLauncher = require('../../processes/processLauncher');
|
||||||
const constants = require('../../constants');
|
const constants = require('../../constants');
|
||||||
const {canonicalHost} = require('../../utils/host');
|
const {canonicalHost} = require('../../utils/host');
|
||||||
|
|
||||||
|
@ -87,7 +87,7 @@ class StorageProcessesLauncher {
|
||||||
if (self.processes[storageName]) {
|
if (self.processes[storageName]) {
|
||||||
return callback(__('Storage process already started'));
|
return callback(__('Storage process already started'));
|
||||||
}
|
}
|
||||||
const filePath = utils.joinPath(__dirname, `./${storageName}.js`);
|
const filePath = utils.joinPath(__dirname, `../${storageName}/process.js`);
|
||||||
fs.access(filePath, (err) => {
|
fs.access(filePath, (err) => {
|
||||||
if (err) {
|
if (err) {
|
||||||
return callback(__('No process file for this storage type (%s) exists. Please start the process locally.', storageName));
|
return callback(__('No process file for this storage type (%s) exists. Please start the process locally.', storageName));
|
|
@ -2,7 +2,8 @@ const UploadSwarm = require('./upload.js');
|
||||||
const utils = require('../../utils/utils.js');
|
const utils = require('../../utils/utils.js');
|
||||||
const fs = require('../../core/fs.js');
|
const fs = require('../../core/fs.js');
|
||||||
const Web3Bzz = require('web3-bzz');
|
const Web3Bzz = require('web3-bzz');
|
||||||
const StorageProcessesLauncher = require('../../processes/storageProcesses/storageProcessesLauncher');
|
// TODO: not great, breaks module isolation
|
||||||
|
const StorageProcessesLauncher = require('../storage/storageProcessesLauncher');
|
||||||
|
|
||||||
class Swarm {
|
class Swarm {
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
const child_process = require('child_process');
|
const child_process = require('child_process');
|
||||||
const ProcessWrapper = require('../processWrapper');
|
const ProcessWrapper = require('../../processes/processWrapper');
|
||||||
const constants = require('../../constants');
|
const constants = require('../../constants');
|
||||||
const fs = require('../../core/fs');
|
const fs = require('../../core/fs');
|
||||||
|
|
Loading…
Reference in New Issue