Permalink
Browse files

move prototype, fix js style, add MyUtil.spawn

  • Loading branch information...
1 parent d8562fd commit 40f65dcd2b2822a28e24f3760420e56911f19116 @zmmbreeze committed Jan 11, 2013
View
29 bin/blogin
@@ -1,20 +1,19 @@
#!/usr/bin/env node
-var args = process.argv.slice(2)
- , commandName = args.shift()
- , commands = require('../lib/command')
- ;
+var args = process.argv.slice(2);
+var commandName = args.shift();
+var commands = require('../lib/command');
switch (commandName) {
- case '-v':
- case '--version':
- case 'ver':
- case 'version':
- var version = require('../package.json').version;
- console.log(version);
- break;
- default:
- var command = commands[commandName] || commands.help;
- command(args);
- break;
+ case '-v':
+ case '--version':
+ case 'ver':
+ case 'version':
+ var version = require('../package.json').version;
+ console.log(version);
+ break;
+ default:
+ var command = commands[commandName] || commands.help;
+ command(args);
+ break;
}
View
1 index.html
@@ -1 +0,0 @@
-<!DOCTYPE html><html><head><title>Blogin's blog</title><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="keyword" content="undefined"><meta name="description" content="A static blog base on blogin."><link href="/public/stylesheet/style.css"></head><body><div class="container"><div class="hd"><h1>Blogin's blog</h1></div><div class="bd"><div class="main"><ul class="articles"><li><a href="/post/2012/hello-worldd.html" title="Hello worldd">Hello worldd </a></li></ul><ul class="pages"><li><a href="/page/hello-world.html" title="Hello world">Hello world </a></li><li><a href="/page/my-first-page.html" title="My first page">My first page </a></li></ul></div><div class="side"><div class="info">Your infomation</div><div class="archives"><h2>Archives</h2><ul><li><a href="/post/2012/" title="2012">2012 </a></li></ul></div></div></div><div class="ft"><p>Powered by <a href="/">blogin</a></p><p>Copyright &copy; 2012 MZhou / @zhoumm</p></div></div></body></html>
View
26 lib/MyUtil.coffee
@@ -1,5 +1,6 @@
path = require('path')
util = require('util')
+spawn = require('child_process').spawn
file = require('./file')
checkProjectDir = exports.checkProjectDir = (dirPath) ->
@@ -89,4 +90,27 @@ exports.updateInfos = () ->
page.mtime = file.getMTime(filePath)
infos.page.push(page)
- file.write(infoFile, JSON.stringify(infos, null, 4))
+ file.write(infoFile, JSON.stringify(infos, null, 4))
+
+###
+ command: 'git'
+ args: ['add', '-A']
+ options:
+ cwd: process.cwd
+ exit: () ->
+ stdout: () ->
+###
+exports.spawn = (options) ->
+ comm = spawn(options.command, options.args, options.options)
+
+ comm.stdout.setEncoding('utf8')
+ comm.stderr.setEncoding('utf8')
+
+ comm.stdout.on('data', options.stdout || (data) ->
+ console.log(data);
+
+ comm.stdout.on('data', options.stdout || (data) ->
+ console.log(data);
+
+ if options.exit
+ comm.on('exit', options.exit);
View
1 lib/deploy.coffee
@@ -0,0 +1 @@
+MyUtil = require('./MyUtil')
View
7 lib/deploy.js
@@ -0,0 +1,7 @@
+// Generated by CoffeeScript 1.4.0
+(function() {
+ var MyUtil;
+
+ MyUtil = require('./MyUtil');
+
+}).call(this);
View
0 lib/init.coffee
No changes.
View
6 lib/init.js
@@ -0,0 +1,6 @@
+// Generated by CoffeeScript 1.4.0
+(function() {
+
+
+
+}).call(this);
View
3 page/hello-world.html
@@ -1,3 +0,0 @@
-<!DOCTYPE html><html><head><title>Blogin's blog - Hello world</title><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="keyword" content="undefined"><meta name="description" content="A static blog base on blogin."><link href="/public/stylesheet/style.css"></head><body><div class="container"><div class="hd"><h1>Hello world</h1><div class="head-meta">2012-11-11</div></div><div class="bd"><div class="main"><div class="entry"></div><h1>hello world</h1>
-
-<h2>asdasd</h2></div><div class="side"><div class="info">Your infomation</div></div></div><div class="ft"><p>Powered by <a href="/">blogin</a></p><p>Copyright &copy; 2012 MZhou / @zhoumm</p></div></div></body></html>
View
1 page/my-first-page.html
@@ -1 +0,0 @@
-<!DOCTYPE html><html><head><title>Blogin's blog - My first page</title><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="keyword" content="undefined"><meta name="description" content="A static blog base on blogin."><link href="/public/stylesheet/style.css"></head><body><div class="container"><div class="hd"><h1>My first page</h1><div class="head-meta">2012-11-11</div></div><div class="bd"><div class="main"><div class="entry"></div><h1>my first page</h1></div><div class="side"><div class="info">Your infomation</div></div></div><div class="ft"><p>Powered by <a href="/">blogin</a></p><p>Copyright &copy; 2012 MZhou / @zhoumm</p></div></div></body></html>
View
BIN post/2012/.DS_Store
Binary file not shown.
View
1 post/2012/hello-worldd.html
@@ -1 +0,0 @@
-<!DOCTYPE html><html><head><title>Blogin's blog - Hello worldd</title><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="keyword" content="undefined"><meta name="description" content="A static blog base on blogin."><link href="/public/stylesheet/style.css"></head><body><div class="container"><div class="hd"><h1>Hello worldd</h1><div class="head-meta">2012-11-11</div></div><div class="bd"><div class="main"><div class="entry"></div> <h1>Hello Worldd</h1></div><div class="side"><div class="info">Your infomation</div></div></div><div class="ft"><p>Powered by <a href="/">blogin</a></p><p>Copyright &copy; 2012 MZhou / @zhoumm</p></div></div></body></html>
View
1 post/2012/index.html
@@ -1 +0,0 @@
-<!DOCTYPE html><html><head><title>Blogin's blog - 2012</title><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="keyword" content="undefined"><meta name="description" content="A static blog base on blogin."><link href="/public/stylesheet/style.css"></head><body><div class="container"><div class="hd"><h1>Blogin's blog</h1></div><div class="bd"><div class="main"><ul class="articles"><li><a href="/post/2012/hello-worldd.html" title="Hello worldd">Hello worldd </a></li></ul></div><div class="side"><div class="info">Your infomation</div></div></div><div class="ft"><p>Powered by <a href="/">blogin</a></p><p>Copyright &copy; 2012 MZhou / @zhoumm</p></div></div></body></html>
View
0 blogin.json → prototype/blogin.json
File renamed without changes.
View
0 data/info → prototype/data/info
File renamed without changes.
View
0 data/pages/hello-world.md → prototype/data/pages/hello-world.md
File renamed without changes.
View
0 data/pages/my-first-page.md → prototype/data/pages/my-first-page.md
File renamed without changes.
View
0 data/posts/2012/.DS_Store → prototype/data/posts/2012/.DS_Store
File renamed without changes.
View
0 data/posts/2012/hello-worldd.md → prototype/data/posts/2012/hello-worldd.md
File renamed without changes.
View
0 public/stylesheet/markdown.css → prototype/public/stylesheet/markdown.css
File renamed without changes.
View
0 public/stylesheet/normalize.css → prototype/public/stylesheet/normalize.css
File renamed without changes.
View
0 public/stylesheet/style.css → prototype/public/stylesheet/style.css
File renamed without changes.
View
0 public/template/archive.jade → prototype/public/template/archive.jade
File renamed without changes.
View
0 public/template/includes/foot.jade → prototype/public/template/includes/foot.jade
File renamed without changes.
View
0 public/template/includes/head.jade → prototype/public/template/includes/head.jade
File renamed without changes.
View
0 public/template/includes/info.jade → prototype/public/template/includes/info.jade
File renamed without changes.
View
0 public/template/index.jade → prototype/public/template/index.jade
File renamed without changes.
View
0 public/template/layout.jade → prototype/public/template/layout.jade
File renamed without changes.
View
0 public/template/page.jade → prototype/public/template/page.jade
File renamed without changes.
View
0 public/template/post.jade → prototype/public/template/post.jade
File renamed without changes.

0 comments on commit 40f65dc

Please sign in to comment.