-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
support for config and
--outDir
argument
- Loading branch information
1 parent
872aa3d
commit d31e0ff
Showing
9 changed files
with
80 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
"use strict"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
const process_1 = require("process"); | ||
const configArgIndex = process_1.argv.indexOf("--config"); | ||
const outDirIndex = process_1.argv.indexOf("--outDir"); | ||
let overrides = {}; | ||
if (configArgIndex > -1 && typeof process_1.argv[configArgIndex + 1] === "string") { | ||
overrides = require(process_1.argv[configArgIndex + 1]); | ||
} | ||
if (outDirIndex > -1 && typeof process_1.argv[outDirIndex + 1] === "string") { | ||
overrides.outDir = process_1.argv[outDirIndex + 1]; | ||
} | ||
exports.default = Object.assign({ outDir: process.cwd() }, overrides); |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import { argv } from "process"; | ||
|
||
export interface cliConfig { | ||
outDir?: string; | ||
} | ||
|
||
const configArgIndex = argv.indexOf("--config"); | ||
const outDirIndex = argv.indexOf("--outDir"); | ||
|
||
let overrides: cliConfig = {}; | ||
|
||
if (configArgIndex > -1 && typeof argv[configArgIndex + 1] === "string") { | ||
overrides = require(argv[configArgIndex + 1]); | ||
} | ||
|
||
if (outDirIndex > -1 && typeof argv[outDirIndex + 1] === "string") { | ||
overrides.outDir = argv[outDirIndex + 1]; | ||
} | ||
|
||
export default { | ||
outDir: process.cwd(), | ||
...overrides, | ||
} as cliConfig; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters