Skip to content

Commit

Permalink
Improved NPM script
Browse files Browse the repository at this point in the history
  • Loading branch information
RicoSuter committed Aug 16, 2017
1 parent a1bd8d4 commit b135aec
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/NSwag.Npm/bin/nswag.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ if (process.env["windir"]) {
}

var c = require('child_process');
if (hasFullDotNet && args.indexOf("--core") == -1) {
if (hasFullDotNet && args.indexOf("--core") == -1 && args.indexOf("/runtime:core") == -1) {
// Run full .NET version
if (args.indexOf("--x86") != -1) {
if (args.indexOf("--x86") != -1 || args.toLowerCase().indexOf("/runtime:x86") != -1) {
var cmd = '"' + __dirname + '/binaries/full/nswag.x86.exe" ' + args;
var code = c.execSync(cmd, { stdio: [0, 1, 2] });
} else {
Expand All @@ -41,7 +41,7 @@ if (hasFullDotNet && args.indexOf("--core") == -1) {
for (let version of supportedCoreVersions) {
var coreCmd = 'dotnet "' + __dirname + '/binaries/netcoreapp' + version + '/dotnet-nswag.dll" ' + args;

if (args.indexOf("--core " + version) != -1) {
if (args.indexOf("--core " + version) != -1 || args.indexOf("/runtime:core" + version) != -1) {
c.execSync(coreCmd, { stdio: [0, 1, 2] });
return;
} else {
Expand All @@ -55,6 +55,6 @@ if (hasFullDotNet && args.indexOf("--core") == -1) {
}
}
c.execSync(defaultCmd, { stdio: [0, 1, 2] });
return;
});
return;
}

0 comments on commit b135aec

Please sign in to comment.