fconvert 0.1.1 → 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/convert +0 -0
- package/dist/fconvert-picker +0 -0
- package/package.json +1 -1
- package/src/cli/output-picker.ts +18 -3
package/dist/convert
CHANGED
|
Binary file
|
package/dist/fconvert-picker
CHANGED
|
Binary file
|
package/package.json
CHANGED
package/src/cli/output-picker.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { constants as fsConstants } from "node:fs";
|
|
1
|
+
import { constants as fsConstants, realpathSync } from "node:fs";
|
|
2
2
|
import { access, mkdtemp, readFile, rm, writeFile } from "node:fs/promises";
|
|
3
3
|
import { tmpdir } from "node:os";
|
|
4
4
|
import { basename, dirname, extname, join } from "node:path";
|
|
@@ -38,11 +38,26 @@ async function resolvePickerBinary(): Promise<string | undefined> {
|
|
|
38
38
|
return envPath;
|
|
39
39
|
}
|
|
40
40
|
|
|
41
|
-
|
|
41
|
+
let execDir = dirname(process.execPath);
|
|
42
|
+
let argv0Dir = dirname(Bun.argv[0] ?? process.cwd());
|
|
42
43
|
const argv1Dir = dirname(Bun.argv[1] ?? process.cwd());
|
|
43
44
|
|
|
45
|
+
try {
|
|
46
|
+
execDir = dirname(realpathSync(process.execPath));
|
|
47
|
+
} catch {
|
|
48
|
+
execDir = dirname(process.execPath);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
try {
|
|
52
|
+
argv0Dir = dirname(realpathSync(Bun.argv[0] ?? process.cwd()));
|
|
53
|
+
} catch {
|
|
54
|
+
argv0Dir = dirname(Bun.argv[0] ?? process.cwd());
|
|
55
|
+
}
|
|
56
|
+
|
|
44
57
|
const candidates = [
|
|
45
58
|
join(process.cwd(), "dist", "fconvert-picker"),
|
|
59
|
+
join(execDir, "fconvert-picker"),
|
|
60
|
+
join(execDir, "dist", "fconvert-picker"),
|
|
46
61
|
join(argv0Dir, "fconvert-picker"),
|
|
47
62
|
join(argv0Dir, "dist", "fconvert-picker"),
|
|
48
63
|
join(argv1Dir, "..", "dist", "fconvert-picker"),
|
|
@@ -84,7 +99,7 @@ export async function pickOutputFormatInteractive(
|
|
|
84
99
|
const pickerBinary = await resolvePickerBinary();
|
|
85
100
|
if (!pickerBinary) {
|
|
86
101
|
throw new CliError(
|
|
87
|
-
"Output picker binary not found.
|
|
102
|
+
"Output picker binary not found. Reinstall fconvert or pass --to for non-interactive selection.",
|
|
88
103
|
ExitCode.EnvironmentError,
|
|
89
104
|
);
|
|
90
105
|
}
|