Skip to content

Commit d89b476

Browse files
committed
WIP
1 parent eeecf85 commit d89b476

File tree

2 files changed

+23
-4
lines changed

2 files changed

+23
-4
lines changed

packages/angular/cli/src/package-managers/package-manager.ts

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -555,10 +555,19 @@ export class PackageManager {
555555
const flags = [options.ignoreScripts ? this.descriptor.ignoreScriptsFlag : ''].filter(
556556
(flag) => flag,
557557
);
558-
const args: readonly string[] = [this.descriptor.addCommand, specifier, ...flags];
559558

559+
if (this.name === 'bun') {
560+
flags.push(`--cwd=${workingDirectory}`);
561+
console.log('using bun');
562+
}
563+
564+
const args: readonly string[] = [this.descriptor.addCommand, specifier, ...flags, '--verbose'];
565+
console.log('Acquire in: ', workingDirectory);
560566
try {
561-
await this.#run(args, { ...options, cwd: workingDirectory });
567+
await this.#run(args, {
568+
...options,
569+
cwd: this.name !== 'bun' ? workingDirectory : undefined,
570+
});
562571
} catch (e) {
563572
// If the command fails, clean up the temporary directory immediately.
564573
await cleanup();

tests/e2e/utils/registry.ts

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,11 +75,11 @@ export async function createNpmConfigForAuthentication(
7575
scopedAuthentication
7676
? `
7777
${registry}/:_auth="${token}"
78-
registry=http:${registry}
78+
registry=http:${registry}/
7979
`
8080
: `
8181
_auth="${token}"
82-
registry=http:${registry}
82+
registry=http:${registry}/
8383
`,
8484
);
8585

@@ -95,6 +95,16 @@ _auth "${token}"
9595
registry http:${registry}
9696
`,
9797
);
98+
99+
if (scopedAuthentication) {
100+
await writeFile(
101+
'bunfig.toml',
102+
`
103+
[install.scopes]
104+
angular = { url = "http:${registry}/", auth = "${token}" }
105+
`,
106+
);
107+
}
98108
}
99109

100110
export function setNpmEnvVarsForAuthentication(

0 commit comments

Comments
 (0)