Skip to content

Commit d1bcb84

Browse files
dnplkndllclaude
andcommitted
fix: read version.txt before git tags in show_version.js
The script only read version.txt when git describe succeeded, falling back to hardcoded "0.6.0" when no tags exist (e.g. in forks). This caused the model version to be 0.6.0 instead of the value in version.txt, making the fulltext indexer skip all workspaces. Now reads version.txt first, falls back to git tags, then "0.6.0". Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> Signed-off-by: Don Kendall <kendall@donkendall.com>
1 parent bd2cf3e commit d1bcb84

1 file changed

Lines changed: 15 additions & 10 deletions

File tree

common/scripts/show_version.js

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -18,21 +18,26 @@ const path = require('path')
1818
const exec = require('child_process').exec
1919

2020
function main() {
21+
// Read version from version.txt first, fall back to git tag, then default
22+
let version
23+
try {
24+
const versionFilePath = path.resolve(__dirname, 'version.txt')
25+
version = fs.readFileSync(versionFilePath, 'utf8').trim()
26+
} catch (error) {
27+
// version.txt not found
28+
}
29+
30+
if (version) {
31+
console.log(version)
32+
return
33+
}
34+
2135
exec('git describe --tags --abbrev=0', (err, stdout) => {
2236
if (err !== null) {
2337
console.log('"0.6.0"')
2438
return
2539
}
26-
// Take version from file
27-
let version
28-
try {
29-
const versionFilePath = path.resolve(__dirname, 'version.txt')
30-
version = fs.readFileSync(versionFilePath, 'utf8').trim()
31-
} catch (error) {
32-
version = '"0.6.0"'
33-
}
34-
35-
console.log(version)
40+
console.log(`"${stdout.trim()}"`)
3641
})
3742
}
3843

0 commit comments

Comments
 (0)