@@ -17,6 +17,8 @@ import * as path from "node:path";
1717
1818import * as yaml from "yaml" ;
1919
20+ import { BUILTIN_LANGUAGES_FILE } from "./config" ;
21+
2022const codeqlPath = process . argv [ 2 ] || "codeql" ;
2123
2224// Step 1: Resolve all language extractor directories.
@@ -75,19 +77,11 @@ const aliases: Record<string, string> = Object.fromEntries(
7577 . sort ( ( [ a ] , [ b ] ) => a . localeCompare ( b ) ) ,
7678) ;
7779
78- // Step 4: Write builtin.json.
79- const outputPath = path . join (
80- __dirname ,
81- ".." ,
82- "src" ,
83- "languages" ,
84- "builtin.json" ,
85- ) ;
86-
80+ // Step 4: Update the built-in languages file.
8781const content = `${ JSON . stringify ( { languages, aliases } , null , 2 ) } \n` ;
88- fs . mkdirSync ( path . dirname ( outputPath ) , { recursive : true } ) ;
89- fs . writeFileSync ( outputPath , content ) ;
82+ fs . mkdirSync ( path . dirname ( BUILTIN_LANGUAGES_FILE ) , { recursive : true } ) ;
83+ fs . writeFileSync ( BUILTIN_LANGUAGES_FILE , content ) ;
9084
91- console . log ( `\nWrote ${ outputPath } ` ) ;
85+ console . log ( `\nWrote ${ BUILTIN_LANGUAGES_FILE } ` ) ;
9286console . log ( ` Languages: ${ languages . join ( ", " ) } ` ) ;
9387console . log ( ` Aliases: ${ Object . keys ( aliases ) . join ( ", " ) } ` ) ;
0 commit comments