Skip to content

Commit 1e9d7ea

Browse files
committed
update publish script
1 parent 535e536 commit 1e9d7ea

File tree

1 file changed

+1
-30
lines changed

1 file changed

+1
-30
lines changed

scripts/publish.js

+1-30
Original file line numberDiff line numberDiff line change
@@ -10,38 +10,9 @@ const exec = (command, extraEnv) =>
1010
env: Object.assign({}, process.env, extraEnv)
1111
});
1212

13-
const execOut = (command, extraEnv) =>
14-
execSync(command, {
15-
stdio: "pipe",
16-
env: Object.assign({}, process.env, extraEnv)
17-
}).toString('utf8').trim();
18-
19-
const branch = execOut('git rev-parse --symbolic-full-name --abbrev-ref HEAD');
20-
21-
if (branch !== 'master') {
22-
console.log('You must be on branch "master" to run: npm run publish');
23-
process.exit(1);
24-
}
25-
26-
const bump = process.argv[3];
27-
28-
if (!bump || !['major', 'minor', 'patch'].includes(bump)) {
29-
console.log(`Please pass (major|minor|patch) as an argument.`);
30-
console.log(`example: npm run publish minor`);
31-
process.exit(1);
32-
}
33-
34-
console.log('Making sure we have the latest master changes.');
35-
exec('git pull');
36-
37-
console.log(`Creating new ${bump} version of react-governor.`);
13+
console.log(`Building react-governor.`);
3814
exec('npm run build');
3915

40-
// This will fail and exit if the git working directory is not clean
41-
// This updates and commits the package.json
42-
console.log('Updating package.json');
43-
exec(`npm version ${bump}`);
44-
4516
const packageJSON = require("../package.json");
4617
console.log('Pushing to npm repository');
4718
exec('npm publish --access public');

0 commit comments

Comments
 (0)