forked from parcel-bundler/parcel
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathverdaccioPublish.js
More file actions
31 lines (26 loc) · 763 Bytes
/
Copy pathverdaccioPublish.js
File metadata and controls
31 lines (26 loc) · 763 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 {execSync} = require('child_process');
const fs = require('fs');
const path = require('path');
const run = cmd => execSync(cmd, {encoding: 'utf8', cwd: __dirname});
const bin = cmd => path.join(__dirname, 'node_modules/.bin', cmd);
const sha = run('git rev-parse --short HEAD').trim();
const version = JSON.parse(
fs.readFileSync(
path.join(__dirname, 'packages/core/core/package.json'),
'utf8',
),
).version;
try {
run(
`${bin(
'lerna',
)} version -y --no-push --no-git-tag-version --exact ${version}-${sha}`,
);
run(`git add .`);
run(`git commit -m 'Temp' --no-verify`);
run(
`${bin('lerna')} publish -y --registry http://localhost:4000 from-package`,
);
} finally {
execSync(`git reset --hard ${sha}`);
}