This repository has been archived by the owner on Mar 13, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
split vulcan.js into vulcanize bin and lib/vulcan.js
- Loading branch information
Showing
2 changed files
with
41 additions
and
28 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
#!/usr/bin/env node | ||
var path = require('path'); | ||
var nopt = require('nopt'); | ||
var vulcan = require('../lib/vulcan.js'); | ||
|
||
var options = nopt( | ||
{ | ||
'output': path, | ||
'verbose': Boolean, | ||
'csp': Boolean, | ||
'inline': Boolean | ||
}, | ||
{ | ||
'o': ['--output'], | ||
'v': ['--verbose'] | ||
} | ||
); | ||
|
||
options.input = path.resolve(options.argv.remain[0]); | ||
|
||
if (!options.input) { | ||
console.error('No input file given!'); | ||
process.exit(1); | ||
} | ||
|
||
var DEFAULT_OUTPUT = 'vulcanized.html'; | ||
if (!options.output) { | ||
console.warn('Default output to vulcanized.html' + (options.csp ? ' and vulcanized.js' : '') + ' in the input directory.'); | ||
options.output = path.resolve(path.dirname(options.input), DEFAULT_OUTPUT); | ||
} | ||
|
||
options.outputDir = path.dirname(options.output); | ||
|
||
vulcan.setOptions(options); | ||
vulcan.processDocument(); |
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