Skip to content

Commit

Permalink
clean up bin script
Browse files Browse the repository at this point in the history
  • Loading branch information
vanetix committed Mar 21, 2013
1 parent dd4d108 commit 3b13afa
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
12 changes: 7 additions & 5 deletions bin/artificer
Expand Up @@ -15,10 +15,11 @@ var artificer = require('../'),

commander
.version(package.version)
.option('-v, --verbose', 'output verbose logging messages')
.option('-t, --title [NAME]', 'set the title on generated pages', '')
.option('-s, --source [PATH]', 'source directory path - must be a directory', '')
.option('-d, --destination [PATH]', 'destination directory path - must not exist', '')
.option('-c, --config [NAME]', 'change the default name artificer uses for configuration files')
.option('-t, --title [NAME]', 'set the title on generated pages', '')
.option('-l, --layout [PATH]' 'handlebars layout to use for render - {{title}} and {{content}} are passed')
.parse(process.argv);

/**
Expand All @@ -33,16 +34,17 @@ if(!src || !dest) {
}

if(!utils.exists(src) || utils.isFile(src)) {
process.stdout.write(' Source directory does not exist');
process.stdout.write(' Source directory does not exist.\n');
commander.help();
}

if(utils.exists(dest)) {
process.stdout.write(' Destination already exists on the filesystem');
process.stdout.write(' Destination already exists on the filesystem.\n');
commander.help();
}

artificer(src, dest, {
title: commander.title,
config: commander.config
config: commander.config,
verbose: commander.verbose
});
5 changes: 4 additions & 1 deletion package.json
@@ -1,13 +1,16 @@
{
"name": "artificer",
"version": "0.0.0",
"version": "0.0.1",
"description": "Markdown to html site generator.",
"author": "vanetix",
"main": "index.js",
"repository": {
"type": "git",
"url": "https://github.com/vanetix/artificer.git"
},
"bin": {
"artificer": "./bin/artificer"
},
"keywords": [
"static",
"site",
Expand Down

0 comments on commit 3b13afa

Please sign in to comment.