mirror of
https://gitea.toothfairyai.com/ToothFairyAI/tf_code.git
synced 2026-04-16 21:54:56 +00:00
Bump to 1.0.38: fix postinstall not copying app dir when binary exists
The postinstall.mjs early-returned when the binary was already present, skipping the app/ directory copy from the platform package entirely. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"$schema": "https://json.schemastore.org/package.json",
|
||||
"version": "1.0.37",
|
||||
"version": "1.0.38",
|
||||
"name": "@toothfairyai/tfcode",
|
||||
"type": "module",
|
||||
"license": "MIT",
|
||||
|
||||
@@ -93,6 +93,25 @@ async function downloadBinary() {
|
||||
|
||||
if (fs.existsSync(existingBinary)) {
|
||||
console.log(`✓ Binary already exists at ${existingBinary}`)
|
||||
// Still need to copy app dir from platform package if missing
|
||||
const targetAppDir = path.join(binDir, "app")
|
||||
if (!fs.existsSync(path.join(targetAppDir, "dist", "index.html"))) {
|
||||
let target = `tfcode-${platform}-${arch}`
|
||||
if (needsBaseline) target += "-baseline"
|
||||
if (abi) target += `-${abi}`
|
||||
const pkgName = `@toothfairyai/${target}`
|
||||
try {
|
||||
const pkgUrl = import.meta.resolve(`${pkgName}/package.json`)
|
||||
const pkgDir = path.dirname(fileURLToPath(pkgUrl))
|
||||
const srcAppDir = path.join(pkgDir, "bin", "app")
|
||||
if (fs.existsSync(path.join(srcAppDir, "dist", "index.html"))) {
|
||||
fs.cpSync(srcAppDir, targetAppDir, { recursive: true })
|
||||
console.log("✓ Web app copied from platform package")
|
||||
}
|
||||
} catch (e) {
|
||||
console.log(`! Could not copy web app: ${e.message}`)
|
||||
}
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user