Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/swift-schools-live.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@somewhatabstract/x": patch
---

Make sure that we resolve to realpaths when comparing file paths in module import
3 changes: 2 additions & 1 deletion src/bin/x.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/usr/bin/env node
import {realpathSync} from "node:fs";
import {fileURLToPath} from "node:url";
import yargs from "yargs";
import {hideBin} from "yargs/helpers";
Expand Down Expand Up @@ -134,7 +135,7 @@ export async function main(rawArgv: string[]): Promise<XResult> {

// Only run main if we aren't being imported as a module.
/* v8 ignore start -- runtime-only CLI bootstrap */
if (process.argv[1] === fileURLToPath(import.meta.url)) {
if (realpathSync(process.argv[1]) === fileURLToPath(import.meta.url)) {
main(process.argv)
.then((result) => {
process.exit(result.exitCode);
Expand Down
Loading