Commit 2a555df8 authored by Tim Neutkens's avatar Tim Neutkens

Add page argument

parent c1784816
...@@ -9,7 +9,8 @@ const argv = parseArgs(process.argv.slice(2), { ...@@ -9,7 +9,8 @@ const argv = parseArgs(process.argv.slice(2), {
alias: { alias: {
h: 'help' h: 'help'
}, },
boolean: ['h'] boolean: ['h'],
string: ['page']
}) })
if (argv.help) { if (argv.help) {
...@@ -28,6 +29,7 @@ if (argv.help) { ...@@ -28,6 +29,7 @@ if (argv.help) {
} }
const dir = resolve(argv._[0] || '.') const dir = resolve(argv._[0] || '.')
const pages = argv.page
// Check if pages dir exists and warn if not // Check if pages dir exists and warn if not
if (!existsSync(dir)) { if (!existsSync(dir)) {
...@@ -42,7 +44,7 @@ if (!existsSync(join(dir, 'pages'))) { ...@@ -42,7 +44,7 @@ if (!existsSync(join(dir, 'pages'))) {
printAndExit('> Couldn\'t find a `pages` directory. Please create one under the project root') printAndExit('> Couldn\'t find a `pages` directory. Please create one under the project root')
} }
build(dir) build({dir, pages})
.catch((err) => { .catch((err) => {
printAndExit(err) printAndExit(err)
}) })
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment