Make path to ODM a config option

pull/1/head
Matthew Berryman 2016-07-29 09:44:24 +10:00
rodzic 422de4e792
commit 3538bfa9d5
2 zmienionych plików z 10 dodań i 9 usunięć

Wyświetl plik

@ -19,6 +19,8 @@ let config = {};
// Instance name - default name for this configuration (will be server process name)
config.instance = 'node-OpenDroneMap';
config.odm_path = '/code';
// Logging configuration
config.logger = {};

Wyświetl plik

@ -17,8 +17,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
"use strict";
let spawn = require('child_process').spawn;
const ODM_PATH = "/code";
let config = require('./config.js');
module.exports = {
run: function(options = {
@ -26,9 +25,9 @@ module.exports = {
}, done, outputReceived){
// Launch
let childProcess = spawn("python", [`${ODM_PATH}/run.py`,
let childProcess = spawn("python", [`${config.odm_path}/run.py`,
"--project-path", options.projectPath
], {cwd: ODM_PATH});
], {cwd: config.odm_path});
childProcess
.on('exit', (code, signal) => done(null, code, signal))
@ -43,7 +42,7 @@ module.exports = {
getJsonOptions: function(done){
// Launch
let childProcess = spawn("python", [`${__dirname}/../helpers/odmOptionsToJson.py`,
"--project-path", ODM_PATH]);
"--project-path", config.odm_path]);
let output = [];
childProcess