From 3954e062db44cb24e4a0d5ba769eb1dc28135b0a Mon Sep 17 00:00:00 2001 From: hua1995116 <461249104@qq.com> Date: Tue, 10 Jul 2018 22:00:44 +0800 Subject: [PATCH 1/2] feature: open on browser --- examples/index.js | 7 ++++++- examples/package.json | 5 +++++ 2 files changed, 11 insertions(+), 1 deletion(-) create mode 100644 examples/package.json diff --git a/examples/index.js b/examples/index.js index 18123e2..35d6582 100644 --- a/examples/index.js +++ b/examples/index.js @@ -1,5 +1,7 @@ const express = require('express'); const app = express(); +const open = require("open"); + const router = express.Router(); router.get('/', function (req, res, next) { req.url = './index.html'; @@ -8,4 +10,7 @@ router.get('/', function (req, res, next) { app.use(router); app.use(express.static('./dist')); -const server = app.listen(3000) \ No newline at end of file +const server = app.listen(3000, () => { + console.log('success on localhost:3000'); + open('http://localhost:3000'); +}) \ No newline at end of file diff --git a/examples/package.json b/examples/package.json new file mode 100644 index 0000000..754ae6d --- /dev/null +++ b/examples/package.json @@ -0,0 +1,5 @@ +{ + "devDependencies": { + "open": "^0.0.5" + } +} From eaa49d9d7c9e3b472994aebf4e82ee3a0ce8c409 Mon Sep 17 00:00:00 2001 From: hua1995116 <461249104@qq.com> Date: Fri, 20 Jul 2018 11:34:39 +0800 Subject: [PATCH 2/2] fix: empty bug --- lib/auto-git/match/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/auto-git/match/index.js b/lib/auto-git/match/index.js index 7b1f14a..00ec277 100644 --- a/lib/auto-git/match/index.js +++ b/lib/auto-git/match/index.js @@ -50,7 +50,7 @@ function match(str) { } else { // 如果不用建立层级,在attr中加入变化属性 const line = item.trim(); - if(line[0] === '-' || line[0] === '+') { + if((line[0] === '-' || line[0] === '+') && line.length > 1) { curObj.attr.push(line); } }