Skip to content

Commit 9cba62d

Browse files
committed
Format tool definitions whenever we generate them
1 parent dac33f3 commit 9cba62d

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

scripts/generate-tool-definitions.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
import { writeFileSync } from 'fs'
44
import { join } from 'path'
5+
import { execSync } from 'child_process'
56

67
import { compileToolDefinitions } from '@codebuff/common/tools/compile-tool-definitions'
78

@@ -18,6 +19,10 @@ function main() {
1819

1920
writeFileSync(outputPath, content, 'utf8')
2021

22+
// Format the generated file with prettier
23+
console.log('🎨 Formatting generated file...')
24+
execSync(`npx prettier --write "${outputPath}"`, { stdio: 'inherit' })
25+
2126
console.log('✅ Successfully generated tools.d.ts')
2227
console.log(`📁 Output: ${outputPath}`)
2328
} catch (error) {

0 commit comments

Comments
 (0)