Check for input file before trying to use
This commit is contained in:
parent
8eb25475b4
commit
8e776fe16b
1 changed files with 3 additions and 2 deletions
|
|
@ -18,14 +18,15 @@ program
|
|||
.parse(process.argv)
|
||||
|
||||
let inputFile = program.args[0]
|
||||
let outputFile =
|
||||
program.args[1] || `${splitFileName(program.args[0])[0]}-output.css`
|
||||
|
||||
if (!inputFile) {
|
||||
console.error('No input file given!')
|
||||
process.exit(1)
|
||||
}
|
||||
|
||||
let outputFile =
|
||||
program.args[1] || `${splitFileName(program.args[0])[0]}-output.css`
|
||||
|
||||
fs.readFile(path.join(program.config), (err, config) => {
|
||||
if (err) {
|
||||
console.error(`config file ${program.config} does not exist`)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue