-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnpm.sh
47 lines (40 loc) · 850 Bytes
/
npm.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
echo '---------------------'
echo 'Cleaning files...'
rm -rf node_modules
rm -rf npm
rm -rf dist
wait
echo '---------------------'
echo 'Installing dependencies...'
npm i
wait
echo '---------------------'
echo 'Building...'
npm run build
wait
echo '---------------------'
echo 'Preparing "npm" folder to deploy...'
mkdir npm
cp -fR dist npm
cp README.md npm/README.md
cp package.json npm/package.json
rm -rf dist
cd npm
echo '---------------------'
echo 'Getting Git URL...'
GITURL=`git config remote.origin.url`
echo '---------------------'
echo 'Creating Git branch...'
git init
git remote add origin $GITURL
git add .
git commit -am 'npm publish'
echo '---------------------'
echo 'Pushing "npm" branch on Git...'
git push origin master:npm --force
wait
echo '---------------------'
echo 'Cleaning temporary files...'
cd ..
rm -rf npm
wait