File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -47,6 +47,7 @@ script:
4747before_deploy :
4848 - FULL_PACKAGE_VERSION=`sed -n 's/\s*"version":\s*"\([a-zA-Z0-9.\-]\+\)"/\1/p' dist/package.json`
4949 - mv dist/$PACKAGE_NAME-$FULL_PACKAGE_VERSION.tgz ../.deploymentpackage
50+ - mv .travis ../
5051 - cd ..
5152 - rm -rf android-runtime
5253 - tar -zxvf .deploymentpackage
@@ -55,13 +56,13 @@ before_deploy:
5556 - rm ../.deploymentpackage
5657 - nvm install 4.2.6
5758 - nvm use 4.2.6
59+ - mv ../.travis ./
60+ - node ./.travis/add-publishConfig.js next
5861deploy :
5962 provider : npm
6063 email : nativescript@telerik.com
6164 on :
62- branch : NON-EXISTING-master
63- tags : true
65+ branch : master
6466 skip_cleanup : true
65- tag : next
6667 api_key :
6768 secure : aFJZR8VIbFAlXfFx5G2AveSgpGjr40prghvw8m06X0yvmUQlucwHVyq+Ov0ZD94br8d7OUOPbUzh+p9N/+oXLAXOj3DbQmJaCc+fk/e+avHu1BRy3fg295P9BQau1Abu+2ZO7tUbg5zAqJqhbEgjXsr9B5gxl+vwh4lbDhCPCwo=
Original file line number Diff line number Diff line change 1+ #!/usr/bin/env node
2+
3+ var fsModule = require ( 'fs' ) ;
4+
5+ //Adds a publishConfig section to the package.json file
6+ // and sets a tag to it
7+
8+ var path = './package.json' ;
9+ var fileOptions = { encoding : "utf-8" } ;
10+ var content = fsModule . readFileSync ( path , fileOptions ) ;
11+
12+ var tag = process . argv [ 2 ] ;
13+ if ( ! tag ) {
14+ console . log ( 'Please pass the tag name as an argument!' ) ;
15+ process . exit ( 1 ) ;
16+ }
17+
18+ var packageDef = JSON . parse ( content ) ;
19+ if ( ! packageDef . publishConfig ) {
20+ packageDef . publishConfig = { } ;
21+ }
22+ packageDef . publishConfig . tag = tag ;
23+
24+ var newContent = JSON . stringify ( packageDef , null , ' ' ) ;
25+ fsModule . writeFileSync ( path , newContent , fileOptions ) ;
You can’t perform that action at this time.
0 commit comments