From d6fae200a75cc1f177738b4a7d53c7089b02b7f5 Mon Sep 17 00:00:00 2001 From: dengtongyu Date: Tue, 24 Nov 2020 18:10:59 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 3 ++- app.js | 21 +++++++++++++++++++++ pack.sh | 5 +++++ 3 files changed, 28 insertions(+), 1 deletion(-) create mode 100644 app.js create mode 100755 pack.sh diff --git a/.gitignore b/.gitignore index 063b0e4..c8b9476 100644 --- a/.gitignore +++ b/.gitignore @@ -4,4 +4,5 @@ db.json *.log node_modules/ public/ -.deploy*/ \ No newline at end of file +.deploy*/ +hexo-blog.zip \ No newline at end of file diff --git a/app.js b/app.js new file mode 100644 index 0000000..119d2c2 --- /dev/null +++ b/app.js @@ -0,0 +1,21 @@ +var spawn = require('child_process').spawn; + +free = spawn('hexo', ['server', '-p 4000']); + +free.stdout.on('data', function (data) { + + console.log('standard output:\n' + data); + +}); + +free.stderr.on('data', function (data) { + + console.log('standard error output:\n' + data); + +}); + +free.on('exit', function (code, signal) { + + console.log('child process eixt ,exit:' + code); + +}); \ No newline at end of file diff --git a/pack.sh b/pack.sh new file mode 100755 index 0000000..00a58ef --- /dev/null +++ b/pack.sh @@ -0,0 +1,5 @@ +#!/bin/sh + +echo "正在打包..." +zip -ry -q ./hexo-blog.zip ./ -x "./node_modules/*" -x "./package-lock.json" -x "./wordpress.2020-11-13.xml" -x "./hexo-blog.zip" -x "./db.json" +echo "打包完成!"