Skip to content

Commit

Permalink
🔧 [config] 修改命令脚本代码
Browse files Browse the repository at this point in the history
  • Loading branch information
lanjingling0510 committed Dec 14, 2016
1 parent 325b995 commit f78fd02
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 36 deletions.
34 changes: 0 additions & 34 deletions Makefile

This file was deleted.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
"rainieDoc": "./index.js"
},
"scripts": {
"start": "make start",
"release": "make release",
"start": "./scripts/start.sh",
"release": "./scripts/release.sh",
"build": "rm -rf dist && env NODE_ENV=production webpack --config ./config/webpack.js"
},
"repository": {
Expand Down
5 changes: 5 additions & 0 deletions scripts/release.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/bash

npm run build #打包
node ./index.js #文档
./release_npm.sh #发布npm包
23 changes: 23 additions & 0 deletions scripts/release_npm.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#!/bin/bash

dir=tmp/npm

rm -rf $dir
mkdir $dir

for pattern in CHANGELOG.md \
README.md \
index.js \
package.json \
generateDocsjson.js \
lib/* \
dist/*
do
cp -r "$pattern" "$dir"
done

find "$dir" -type f -name "test.js" -delete
cd "$dir" || exit
npm publish
cd - || exit
rm -rf "$dir"
5 changes: 5 additions & 0 deletions scripts/start.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/bash

rm -rf ./docs.json
ln -s ./example/docs/docs.json ./docs.json
NODE_ENV=development webpack-dev-server --config ./config/webpack.js

0 comments on commit f78fd02

Please sign in to comment.