Skip to content

Commit c7d930b

Browse files
committed
maybe fix
1 parent b68b28f commit c7d930b

3 files changed

Lines changed: 10 additions & 10 deletions

File tree

packages/beachball/src/__fixtures__/registry.ts

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -150,11 +150,8 @@ export class Registry {
150150

151151
/** Run `npm logout` on the fake registry */
152152
public async logout(): Promise<void> {
153-
if (!this.isLoggedIn) {
154-
return;
155-
}
156-
157-
// Conservatively set to false even if it fails partway (logging in again is harmless)
153+
// Conservatively set to false even if it fails partway (logging in again is harmless).
154+
// Also go ahead and log out even if not flagged as logged in since it could be out of sync.
158155
this.isLoggedIn = false;
159156
try {
160157
const registry = this.getUrl();

packages/beachball/src/__functional__/packageManager/packagePublish.test.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -184,11 +184,12 @@ describe('packagePublish', () => {
184184
expect(logs2ndTry).toMatch(`${testSpec} already exists in the registry`);
185185
});
186186

187-
// TODO: remove it.skip once node version is upgraded (this test doesn't work with npm 6 because
187+
// TODO: remove condition once node version is upgraded (this test doesn't work with npm 6 because
188188
// that version seems to allow truly anonymous publishing with verdaccio)
189-
// eslint-disable-next-line no-restricted-properties
190-
const itNotNpm6 = npmVersion.startsWith('6') ? it.skip : it;
191-
itNotNpm6('handles auth error and does not retry', async () => {
189+
it('handles auth error and does not retry', async () => {
190+
if (npmVersion.startsWith('6.')) {
191+
return;
192+
}
192193
await registry.logout();
193194

194195
const testPackageInfo = getTestPackageInfo();

packages/beachball/src/packageManager/packageManager.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,9 @@ export async function packageManager(
1919
const result = await execa(manager, args, {
2020
...options,
2121
// This is required for Windows due to https://nodejs.org/en/blog/vulnerability/april-2024-security-releases-2
22-
shell: true,
22+
// but only provide it on Windows because it breaks oddly-named environment variables
23+
// such as npm_config_//someRegistry/:_authToken on Linux...
24+
...(process.platform === 'win32' && { shell: true }),
2325
});
2426
return {
2527
...result,

0 commit comments

Comments
 (0)