This repository was archived by the owner on Apr 4, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 6 files changed +72
-0
lines changed
Expand file tree Collapse file tree 6 files changed +72
-0
lines changed Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+
3+ SOURCE_DIR=../src;
4+ TO_SOURCE_DIR=src;
5+ PACK_DIR=package;
6+ ROOT_DIR=..;
7+ PUBLISH=--publish
8+
9+ install (){
10+ npm i
11+ }
12+
13+ pack () {
14+
15+ echo ' Clearing /src and /package...'
16+ node_modules/.bin/rimraf " $TO_SOURCE_DIR "
17+ node_modules/.bin/rimraf " $PACK_DIR "
18+
19+ # copy src
20+ echo ' Copying src...'
21+ node_modules/.bin/ncp " $SOURCE_DIR " " $TO_SOURCE_DIR "
22+
23+ # copy README & LICENSE to src
24+ echo ' Copying README and LICENSE to /src...'
25+ node_modules/.bin/ncp " $ROOT_DIR " /LICENSE " $TO_SOURCE_DIR " /LICENSE
26+ node_modules/.bin/ncp " $ROOT_DIR " /README.md " $TO_SOURCE_DIR " /README.md
27+
28+ # compile package and copy files required by npm
29+ echo ' Building /src...'
30+ cd " $TO_SOURCE_DIR "
31+ node_modules/.bin/tsc
32+ cd ..
33+
34+ echo ' Creating package...'
35+ # create package dir
36+ mkdir " $PACK_DIR "
37+
38+ # create the package
39+ cd " $PACK_DIR "
40+ npm pack ../" $TO_SOURCE_DIR "
41+
42+ # delete source directory used to create the package
43+ cd ..
44+ node_modules/.bin/rimraf " $TO_SOURCE_DIR "
45+ }
46+
47+ install && pack
Original file line number Diff line number Diff line change 1+ {
2+ "name" : " nativescript-publish" ,
3+ "version" : " 1.0.0" ,
4+ "description" : " Publish helper" ,
5+ "scripts" : {
6+ "prepublish" : " npm install --ignore-scripts && webpack --config scripts/webpack.config.js scripts/installer.js ../src/scripts/postinstall.js"
7+ },
8+ "devDependencies" : {
9+ "ncp" : " ^2.0.0" ,
10+ "prompt-lite" : " ~0.1.0" ,
11+ "rimraf" : " ^2.5.0" ,
12+ "webpack" : " ~2.2.0"
13+ }
14+ }
Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+
3+ PACK_DIR=package;
4+
5+ publish () {
6+ cd $PACK_DIR
7+ echo ' Publishing to npm...'
8+ # npm publish *.tgz
9+ }
10+
11+ ./pack.sh && publish
File renamed without changes.
File renamed without changes.
File renamed without changes.
You can’t perform that action at this time.
0 commit comments