@toothfairyai/tfcode 1.0.1 → 1.0.3
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/bin/tfcode +0 -0
- package/bin/tfcode.js +2 -4
- package/package.json +1 -1
- package/postinstall.mjs +7 -0
- package/toothfairyai-tfcode-1.0.1.tgz +0 -0
package/bin/tfcode
ADDED
|
Binary file
|
package/bin/tfcode.js
CHANGED
|
@@ -3,13 +3,11 @@ const { spawn } = require("child_process")
|
|
|
3
3
|
const path = require("path")
|
|
4
4
|
const fs = require("fs")
|
|
5
5
|
|
|
6
|
-
const binDir = path.join(__dirname, "bin")
|
|
7
6
|
const binary = process.platform === "win32" ? "tfcode.exe" : "tfcode"
|
|
8
|
-
const binaryPath = path.join(
|
|
7
|
+
const binaryPath = path.join(__dirname, binary)
|
|
9
8
|
|
|
10
9
|
if (!fs.existsSync(binaryPath)) {
|
|
11
|
-
console.error("tfcode binary not found
|
|
12
|
-
console.error("Try running: npm rebuild @toothfairyai/tfcode")
|
|
10
|
+
console.error("tfcode binary not found at " + binaryPath)
|
|
13
11
|
process.exit(1)
|
|
14
12
|
}
|
|
15
13
|
|
package/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name":"@toothfairyai/tfcode","version":"1.0.
|
|
1
|
+
{"name":"@toothfairyai/tfcode","version":"1.0.3","bin":{"tfcode":"./bin/tfcode.js"},"scripts":{"postinstall":"node ./postinstall.mjs"},"license":"MIT","optionalDependencies":{"@toothfairyai/tfcode-darwin-arm64":"1.0.3"},"engines":{"node":">=18"},"homepage":"https://toothfairyai.com/developers/tfcode","repository":{"type":"git","url":"https://gitea.toothfairyai.com/ToothFairyAI/tf_code.git"}}
|
package/postinstall.mjs
CHANGED
|
@@ -4,6 +4,10 @@ import fs from "fs"
|
|
|
4
4
|
import path from "path"
|
|
5
5
|
import os from "os"
|
|
6
6
|
import { spawnSync } from "child_process"
|
|
7
|
+
import { fileURLToPath } from "url"
|
|
8
|
+
|
|
9
|
+
const __filename = fileURLToPath(import.meta.url)
|
|
10
|
+
const __dirname = path.dirname(__filename)
|
|
7
11
|
|
|
8
12
|
const GITEA_HOST = process.env.TFCODE_GITEA_HOST || "gitea.toothfairyai.com"
|
|
9
13
|
const GITEA_REPO = process.env.TFCODE_GITEA_REPO || "ToothFairyAI/tf_code"
|
|
@@ -174,6 +178,9 @@ async function main() {
|
|
|
174
178
|
console.log("━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━")
|
|
175
179
|
console.log("")
|
|
176
180
|
|
|
181
|
+
// Download and setup binary
|
|
182
|
+
await downloadBinary()
|
|
183
|
+
|
|
177
184
|
// Check for Python (needed for TF integration)
|
|
178
185
|
try {
|
|
179
186
|
const result = spawnSync("python3", ["--version"], { encoding: "utf8" })
|
|
Binary file
|