@@ -4,6 +4,7 @@ const jsonfile = require("jsonfile");
4
4
const semver = require ( "semver" ) ;
5
5
6
6
const rootDir = path . resolve ( __dirname , ".." ) ;
7
+ const version = process . argv [ 2 ] ;
7
8
8
9
/**
9
10
* @param {* } cond
@@ -14,14 +15,6 @@ function invariant(cond, message) {
14
15
if ( ! cond ) throw new Error ( message ) ;
15
16
}
16
17
17
- /**
18
- * @returns {string }
19
- */
20
- function getTaggedVersion ( ) {
21
- let output = execSync ( "git tag --list --points-at HEAD" ) . toString ( ) ;
22
- return output . replace ( / ^ v | \n + $ / g, "" ) ;
23
- }
24
-
25
18
/**
26
19
* @param {string } packageName
27
20
* @param {string|number } version
@@ -41,7 +34,7 @@ async function ensureBuildVersion(packageName, version) {
41
34
*/
42
35
function publishBuild ( packageName , tag ) {
43
36
let buildDir = path . join ( rootDir , "packages" , packageName ) ;
44
- let command = `npm publish ${ buildDir } ` + tag ? ` --tag ${ tag } ` : "" ;
37
+ let command = `npm publish ${ buildDir } ` + ( tag ? ` --tag ${ tag } ` : "" ) ;
45
38
console . log ( ) ;
46
39
console . log ( ` ${ command } ` ) ;
47
40
console . log ( ) ;
@@ -60,7 +53,6 @@ async function run() {
60
53
) ;
61
54
62
55
// 1. Get the current tag, which has the release version number
63
- let version = getTaggedVersion ( ) ;
64
56
invariant (
65
57
version !== "" ,
66
58
"Missing release version. Run the version script first."
@@ -71,7 +63,8 @@ async function run() {
71
63
72
64
console . log ( ) ;
73
65
console . log (
74
- ` Publishing version ${ version } to npm` + tag ? ` with tag "${ tag } "` : ""
66
+ ` Publishing version ${ version } to npm` +
67
+ ( tag ? ` with tag "${ tag } "` : "" )
75
68
) ;
76
69
77
70
// 3. Ensure build versions match the release version
0 commit comments