Skip to content

Commit 7c2873b

Browse files
committed
fix: check binary file size, not just existence (v0.2.7)
1 parent 3b3946f commit 7c2873b

3 files changed

Lines changed: 12 additions & 8 deletions

File tree

packages/cli/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "thoth-cli",
3-
"version": "0.2.6",
3+
"version": "0.2.7",
44
"description": "𓅝 Astrological calculations from the command line. Swiss Ephemeris precision. Built for humans and agents.",
55
"author": "AKLO <aklo@aklolabs.com>",
66
"license": "MIT",

packages/cli/scripts/postinstall.js

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@
66

77
import { platform, arch } from 'os';
88
import { join, dirname } from 'path';
9-
import { existsSync, mkdirSync, createWriteStream, chmodSync } from 'fs';
9+
import { existsSync, mkdirSync, createWriteStream, chmodSync, statSync } from 'fs';
1010
import { fileURLToPath } from 'url';
1111
import https from 'https';
1212

1313
const __dirname = dirname(fileURLToPath(import.meta.url));
1414

15-
const VERSION = '0.2.6';
15+
const VERSION = '0.2.7';
1616
const REPO = 'aklo360/thoth-cli';
1717
const BASE_URL = `https://github.com/${REPO}/releases/download/v${VERSION}`;
1818

@@ -69,10 +69,14 @@ async function main() {
6969
const binDir = join(__dirname, '..', 'bin', platformKey);
7070
const binaryPath = join(binDir, binaryName);
7171

72-
// Skip if binary already exists
72+
// Skip if binary already exists AND has content
7373
if (existsSync(binaryPath)) {
74-
console.log(`✓ thoth-core binary already exists`);
75-
return;
74+
const stats = statSync(binaryPath);
75+
if (stats.size > 0) {
76+
console.log(`✓ thoth-core binary already exists`);
77+
return;
78+
}
79+
console.log(`Found empty placeholder, downloading actual binary...`);
7680
}
7781

7882
console.log(`Downloading thoth-core for ${platformKey}...`);

packages/cli/src/bin.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ Examples:
3535
thoth progressions --natal-date 1991-07-08 --natal-time 14:06 --city "New York" --target-date 2026-03-01
3636
thoth moon
3737
thoth ephemeris --body pluto`)
38-
.version('0.2.6');
38+
.version('0.2.7');
3939

4040
// Chart command
4141
program
@@ -725,7 +725,7 @@ program
725725

726726
// Banner
727727
console.log(chalk.dim(''));
728-
console.log(chalk.yellow(' 𓅝') + chalk.dim(' thoth-cli v0.2.6'));
728+
console.log(chalk.yellow(' 𓅝') + chalk.dim(' thoth-cli v0.2.7'));
729729
console.log(chalk.dim(''));
730730

731731
program.parse();

0 commit comments

Comments
 (0)