Skip to content
This repository has been archived by the owner on Jan 19, 2021. It is now read-only.

Commit

Permalink
move marge to bin so it'll work globally first (#216)
Browse files Browse the repository at this point in the history
  • Loading branch information
archlichking authored Mar 23, 2017
1 parent c6493fa commit 2d6570f
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 14 deletions.
17 changes: 17 additions & 0 deletions bin/magellan
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,23 @@

"use strict";

const yargs = require("yargs");
const logger = require("../src/logger");
const margs = require("marge");

const defaultConfigFilePath = "./magellan.json";
const configFilePath = yargs.argv.config;

if (configFilePath) {
logger.log("Will try to load configuration from " + configFilePath);
} else {
logger.log("Will try to load configuration from default of " + defaultConfigFilePath);
}

// NOTE: marge can throw an error here if --config points at a file that doesn't exist
// FIXME: handle this error nicely instead of printing an ugly stack trace
margs.init(defaultConfigFilePath, configFilePath);

require("../src/cli")()
.then(() => process.exit(0))
.catch(() => process.exit(1));
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "testarmada-magellan",
"version": "10.0.3",
"version": "10.0.4",
"description": "Massively parallel automated testing",
"main": "src/main",
"directories": {
Expand Down
13 changes: 0 additions & 13 deletions src/cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,19 +53,6 @@ module.exports = (opts) => {

logger.log("Magellan " + project.version);

const defaultConfigFilePath = "./magellan.json";
const configFilePath = runOpts.yargs.argv.config;

if (configFilePath) {
logger.log("Will try to load configuration from " + configFilePath);
} else {
logger.log("Will try to load configuration from default of " + defaultConfigFilePath);
}

// NOTE: marge can throw an error here if --config points at a file that doesn't exist
// FIXME: handle this error nicely instead of printing an ugly stack trace
runOpts.margs.init(defaultConfigFilePath, configFilePath);

// const isNodeBased = runOpts.margs.argv.framework &&
// runOpts.margs.argv.framework.indexOf("mocha") > -1;

Expand Down

0 comments on commit 2d6570f

Please sign in to comment.