We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 6297992 commit 14a1406Copy full SHA for 14a1406
src/bin.mts
@@ -1,4 +1,5 @@
1
#!/usr/bin/env node
2
+import { realpathSync } from 'fs'
3
import { readFile } from 'fs/promises'
4
import type { RimrafAsyncOptions } from './index.js'
5
import { rimraf } from './index.js'
@@ -260,7 +261,10 @@ const main = async (...args: string[]) => {
260
261
main.help = help
262
263
export default main
-const isMainModule = process.argv[1] === fileURLToPath(import.meta.url)
264
+
265
+const isMainModule =
266
+ realpathSync(String(process.argv[1])) ===
267
+ realpathSync(fileURLToPath(import.meta.url))
268
269
if (isMainModule) {
270
const args = process.argv.slice(2)
0 commit comments