Browse Source

update release script

Daniel Zlotin 7 years ago
parent
commit
62f377905d
2 changed files with 6 additions and 4 deletions
  1. 0
    2
      scripts/.npmrc
  2. 6
    2
      scripts/release.js

+ 0
- 2
scripts/.npmrc View File

@@ -1,2 +0,0 @@
1
-email=${NPM_EMAIL}
2
-//registry.npmjs.org/:_authToken=${NPM_TOKEN}

+ 6
- 2
scripts/release.js View File

@@ -2,6 +2,7 @@
2 2
 const exec = require('shell-utils').exec;
3 3
 const p = require('path');
4 4
 const semver = require('semver');
5
+const fs = require('fs');
5 6
 
6 7
 const VERSION_TAG = 'alpha';
7 8
 const VERSION_INC = 'prerelease';
@@ -43,8 +44,11 @@ function calcNewVersion() {
43 44
 }
44 45
 
45 46
 function createNpmRc() {
46
-  const npmrcPath = p.resolve(`${__dirname}/.npmrc`);
47
-  exec.execSync(`cp -Rf ${npmrcPath} .`);
47
+  const content = `
48
+email=\${NPM_EMAIL}
49
+//registry.npmjs.org/:_authToken=\${NPM_TOKEN}
50
+`;
51
+  fs.writeFileSync(`.npmrc`, content);
48 52
 }
49 53
 
50 54
 function tagAndPublish(newVersion) {