We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0ced014 commit b44ea0cCopy full SHA for b44ea0c
1 file changed
.travis/add-publishConfig.js
@@ -0,0 +1,25 @@
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);
0 commit comments