Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@
"pify": "^4.0.1",
"recursive-readdir": "^2.2.2",
"sc-istanbul": "^0.4.5",
"shelljs": "^0.8.3",
"semver": "^7.3.5",
"solidity-coverage": "^0.7.16",
"truffle": "^5.1.65",
"web3": "^1.3.4",
Expand Down
26 changes: 12 additions & 14 deletions src/SolidityLauncher.ts
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,10 @@ export class SolidityLauncher {
const additionalOptions = {}; // TODO
setupOptions(this._program, additionalOptions);

const args = process.argv.slice(process.argv.indexOf(this._program) + 1);
const index = process.argv.indexOf(process.argv.find((a) => a.includes(this._program)))

const args = process.argv.slice(index + 1);

const myConfig = loadConfig(args);

processConfig(myConfig, args);
Expand Down Expand Up @@ -187,14 +190,14 @@ export class SolidityLauncher {
getUserInterface().report("asciiArt", ["Syntest"]);
getUserInterface().report("version", [require("../package.json").version]);

if (this.config.help) {
this.truffle = loadLibrary(this.config);
this.api = new API(myConfig);

if (args.includes("--help") || args.includes("-h")) {
getUserInterface().report("help", []);
await this.exit();
} // Exit if --help

this.truffle = loadLibrary(this.config);
this.api = new API(myConfig);

setNetwork(this.config, this.api);

// Server launch
Expand All @@ -206,24 +209,19 @@ export class SolidityLauncher {
const nodeInfo = await web3.eth.getNodeInfo();
const ganacheVersion = nodeInfo.split("/")[1];

setNetworkFrom(this.config, accounts);

// Exit if --version
if (this.config.version) {
if (args.includes("--version") || args.includes("-v")) {
getUserInterface().report("versions", [
this.truffle.version,
ganacheVersion,
pkg.version,
]); // Exit if --help

// Finish
await tearDownTempFolders(this.tempContractsDir, this.tempArtifactsDir);
]);

// Shut server down
await this.api.finish();
await this.exit();
}

setNetworkFrom(this.config, accounts);

getUserInterface().report("header", ["GENERAL INFO"]);

getUserInterface().report("property-set", [
Expand Down