Skip to content

Commit 370b8a0

Browse files
committed
scripts
1 parent 402691e commit 370b8a0

File tree

2 files changed

+38
-0
lines changed

2 files changed

+38
-0
lines changed

package.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,14 @@
2020
"package.json"
2121
]
2222
},
23+
"scripts": {
24+
"clean": "shx rm -rf dist",
25+
"debug": "npm run clean && shx cp -r lib dist && NODE_ENV=development BABEL_ENV=development babel dist --out-dir dist",
26+
"dev": "npm run clean && NODE_ENV=development BABEL_ENV=production rollup -c -w",
27+
"build": "npm run clean && NODE_ENV=production BABEL_ENV=production rollup -c",
28+
"ppublish": "bash ./ppublish.sh",
29+
"prepare": "npm run build"
30+
},
2331
"dependencies": {
2432
"fs-plus": "2.x",
2533
"atom-space-pen-views": "^2.0.3"

ppublish.sh

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
#!/bin/bash
2+
3+
echo "$OSTYPE"
4+
if [[ "$OSTYPE" == 'msys' ]]; then
5+
echo 'OS is Windows. Setting npm script-shell to bash'
6+
if test -f 'C:/Program Files/git/bin/bash.exe'; then
7+
npm config set script-shell 'C:/Program Files/git/bin/bash.exe'
8+
echo 'script-shell set to C:/Program Files/git/bin/bash.exe'
9+
elif test -f 'C:/Program Files (x86)/git/bin/bash.exe'; then
10+
npm config set script-shell 'C:/Program Files (x86)/git/bin/bash.exe'
11+
echo 'script-shell set to C:/Program Files (x86)/git/bin/bash.exe'
12+
elif test -f 'C:/Windows/System32/bash.exe'; then
13+
npm config set script-shell 'C:/Windows/System32/bash.exe'
14+
echo 'script-shell set to C:/Windows/System32/bash.exe'
15+
else
16+
error_exit 'git is not installed!'
17+
fi
18+
fi
19+
20+
if test -f '.gitignore'; then
21+
git mv .gitignore .gitignore.back
22+
npm run build
23+
git add -- ./dist
24+
git commit -m 'chore: add built files' -- ./dist
25+
git mv .gitignore.back .gitignore
26+
cd ./dist
27+
git ls-files -z | xargs -0 git update-index --assume-unchanged
28+
else
29+
error_exit '.gitignore does not exist!'
30+
fi

0 commit comments

Comments
 (0)