Skip to content

Commit e1df50e

Browse files
committed
fix(scripts): build file urls with pathToFileURL per the new lint rule
1 parent 6d5b171 commit e1df50e

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

scripts/repo/install-claude-plugins.mts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ import { spawnSync } from '@socketsecurity/lib-stable/process/spawn/child'
3030
import { existsSync, readFileSync } from 'node:fs'
3131
import path from 'node:path'
3232
import process from 'node:process'
33-
import { fileURLToPath } from 'node:url'
33+
import { fileURLToPath, pathToFileURL } from 'node:url'
3434

3535
import { errorMessage } from '@socketsecurity/lib-stable/errors/message'
3636
import { getDefaultLogger } from '@socketsecurity/lib-stable/logger/default'
@@ -407,7 +407,10 @@ function main(): void {
407407

408408
// Skip execution when imported (for tests). The CLI entry is direct
409409
// `node scripts/repo/install-claude-plugins.mts` invocation.
410-
if (import.meta.url === `file://${process.argv[1]}`) {
410+
if (
411+
process.argv[1] &&
412+
import.meta.url === pathToFileURL(process.argv[1]).href
413+
) {
411414
try {
412415
main()
413416
} catch (e) {

0 commit comments

Comments
 (0)