@hubspot/npm-scripts 0.0.5 → 0.0.6-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/release.js +14 -2
package/package.json
CHANGED
package/src/release.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { exec as _exec } from 'node:child_process';
|
|
1
|
+
import { exec as _exec, execSync } from 'node:child_process';
|
|
2
2
|
import { promisify } from 'util';
|
|
3
3
|
import yargs from 'yargs';
|
|
4
4
|
import semver from 'semver';
|
|
@@ -90,6 +90,18 @@ function buildHandler({ build, postLatestRelease, packageName, localVersion, reg
|
|
|
90
90
|
}
|
|
91
91
|
let otp = '';
|
|
92
92
|
if (!isDryRun) {
|
|
93
|
+
try {
|
|
94
|
+
await exec(`npm whoami --registry ${registry}`);
|
|
95
|
+
}
|
|
96
|
+
catch (err) {
|
|
97
|
+
try {
|
|
98
|
+
execSync(`npm adduser --registry ${registry}`, { stdio: 'inherit' });
|
|
99
|
+
}
|
|
100
|
+
catch (authErr) {
|
|
101
|
+
logger.error('Failed to authenticate with npm');
|
|
102
|
+
process.exit(EXIT_CODES.ERROR);
|
|
103
|
+
}
|
|
104
|
+
}
|
|
93
105
|
otp = await input({
|
|
94
106
|
message: 'Enter your NPM one-time password:',
|
|
95
107
|
});
|
|
@@ -134,7 +146,7 @@ function buildHandler({ build, postLatestRelease, packageName, localVersion, reg
|
|
|
134
146
|
logger.log(`Changes pushed successfully`);
|
|
135
147
|
await open(`${repositoryUrl}/compare/${mainBranch}...${tempBranch}`);
|
|
136
148
|
}
|
|
137
|
-
logger.success(
|
|
149
|
+
logger.success(`${packageName} version ${newVersion} published successfully`);
|
|
138
150
|
logger.log(`https://www.npmjs.com/package/${packageName}?activeTab=versions`);
|
|
139
151
|
if (tag === TAG.LATEST) {
|
|
140
152
|
logger.log(`\nRemember to create a new release on Github!`);
|