Skip to content

Commit 12b5aa7

Browse files
committed
refactor(@angular/cli): use named delimiter import in executable utility
1 parent 7bf400a commit 12b5aa7

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

packages/angular/cli/src/utilities/executable.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*/
88

99
import { existsSync } from 'node:fs';
10-
import * as path from 'node:path';
10+
import { delimiter, extname, join } from 'node:path';
1111

1212
/**
1313
* Searches the `PATH` environment variable for a given executable binary name.
@@ -28,19 +28,19 @@ export function findExecutableOnPath(binaryName: string): string | undefined {
2828

2929
const isWindows = process.platform === 'win32';
3030
const pathExt = process.env.PATHEXT
31-
? process.env.PATHEXT.split(path.delimiter)
31+
? process.env.PATHEXT.split(delimiter)
3232
: ['.com', '.exe', '.bat', '.cmd'];
3333

34-
const hasExt = isWindows && path.extname(binaryName) !== '';
34+
const hasExt = isWindows && extname(binaryName) !== '';
3535
const extensions = isWindows && !hasExt ? pathExt : [''];
3636

37-
for (const dir of envPath.split(path.delimiter)) {
37+
for (const dir of envPath.split(delimiter)) {
3838
if (!dir) {
3939
continue;
4040
}
4141

4242
for (const ext of extensions) {
43-
const candidate = path.join(dir, binaryName + ext);
43+
const candidate = join(dir, binaryName + ext);
4444
try {
4545
if (existsSync(candidate)) {
4646
return candidate;

0 commit comments

Comments
 (0)