/
blacksmith
executable file
·62 lines (55 loc) · 2.06 KB
/
blacksmith
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
#!/usr/bin/env node
var flatiron = require("flatiron"),
util = require("utile"),
path = require("path"),
fs = require("fs"),
smith = require("../lib/blacksmith"),
winston = require("winston"), // TODO: Use log plugin
colors = require("colors"),
cliff = require("cliff"),
app = flatiron.app;
app.use(flatiron.plugins.cli, {
dir: __dirname + "/../lib/commands",
usage: [
"",
",, ,, ,, , ,, ".yellow,
"|| || _ || ' || || ".yellow,
"||/|, || < \\, _-_ ||/\\ _-_, \\\\/\\\\/\\\\ \\\\ =||= ||/\\\\ ".yellow,
"|| || || /-|| || ||_< ||_. || || || || || || || ".yellow,
"|| |' || (( || || || | ~ || || || || || || || || ".yellow,
"\\\\/ \\\\ \\/\\\\ \\\\,/ \\\\,\\ ,-_- \\\\ \\\\ \\\\ \\\\ \\\\, \\\\ |/ ".yellow,
" _/ ".yellow,
"",
"The static site generator " + "from "+"Nodejitsu".grey+"!",
"https://github.com/flatiron/blacksmith",
"",
"Usage:".yellow.bold,
"",
" blacksmith <task> <param1> <param2> ...",
"",
"Commands:".yellow.bold,
"",
"* "+"`blacksmith generate`".yellow+": Generate a static site",
"* "+"`blacksmith preview`".yellow +": Serve your static site on localhost",
"* "+"`blacksmith init`".yellow +": Create a new blacksmith site",
"* "+"`blacksmith post`".yellow+": Create a new page for your site",
"",
"For more help, visit:",
"",
"* "+"https://github.com/flatiron/blacksmith".yellow.bold,
""
].join("\n")
});
if (app.argv.v) {
// If version requested, print it and exit without doing anything else.
console.log(util.file.readJsonSync(__dirname + '/../package.json').version);
process.exit();
}
smith.log.info("Welcome to "+"Blacksmith".yellow);
smith.log.info("It worked if it ends with " + "Blacksmith".yellow + " ok".green.bold);
app.init(function (err) {
if (err) {
return err.stack.forEach(winston.error);
}
app.start();
});