-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrelease-ci.js
More file actions
31 lines (28 loc) · 867 Bytes
/
release-ci.js
File metadata and controls
31 lines (28 loc) · 867 Bytes
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
const os = require('os');
const exec = require('child_process').exec;
const fs = require('fs');
function puts(error, stdout, stderr) {
if (stdout || error || stderr) {
console.log(stdout, error, stderr);
}
}
console.log('Start release-ci [' + os.type() + ']...');
// Run command depending on the OS
if (os.type() === 'Linux') {
exec(
"echo 'unsafe-perm = true' > ./.npmrc && yarn run semantic-release && rm -rf ./.npmrc",
puts,
);
} else if (os.type() === 'Darwin') {
exec(
"echo 'unsafe-perm = true' > ./.npmrc && yarn run semantic-release && rm -rf ./.npmrc",
puts,
);
} else if (os.type() === 'Windows_NT') {
exec(
"echo 'unsafe-perm = true' > npmrc && yarn run semantic-release && del npmrc",
puts,
);
} else {
throw new Error('Unsupported OS found: ' + os.type());
}