Skip to content

Commit 4c04b11

Browse files
authored
Rename liquid-tags script (#59068)
1 parent 36915a1 commit 4c04b11

File tree

4 files changed

+142
-89
lines changed

4 files changed

+142
-89
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@
7878
"release-banner": "tsx src/ghes-releases/scripts/release-banner.ts",
7979
"repo-sync": "./src/workflows/local-repo-sync.sh",
8080
"reusables": "tsx src/content-render/scripts/reusables-cli.ts",
81-
"resolve-liquid": "tsx src/content-render/scripts/resolve-liquid.ts",
81+
"liquid-tags": "tsx src/content-render/scripts/liquid-tags.ts",
8282
"rendered-content-link-checker": "tsx src/links/scripts/rendered-content-link-checker.ts",
8383
"rendered-content-link-checker-cli": "tsx src/links/scripts/rendered-content-link-checker-cli.ts",
8484
"rest-dev": "tsx src/rest/scripts/update-files.ts",

src/ai-tools/scripts/ai-tools.ts

Lines changed: 14 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -195,11 +195,11 @@ program
195195
const relativePath = path.relative(process.cwd(), fileToProcess)
196196
spinner.text = `Processing: ${relativePath}`
197197
try {
198-
// Resolve Liquid references before processing
198+
// Expand Liquid references before processing
199199
if (options.verbose) {
200-
console.log(`Resolving Liquid references in: ${relativePath}`)
200+
console.log(`Expanding Liquid references in: ${relativePath}`)
201201
}
202-
runResolveLiquid('resolve', [fileToProcess], options.verbose || false)
202+
runLiquidTagsScript('expand', [fileToProcess], options.verbose || false)
203203

204204
const content = fs.readFileSync(fileToProcess, 'utf8')
205205
const answer = await callEditor(
@@ -235,15 +235,15 @@ program
235235
if (options.verbose) {
236236
console.log(`Restoring Liquid references in: ${relativePath}`)
237237
}
238-
runResolveLiquid('restore', [fileToProcess], options.verbose || false)
238+
runLiquidTagsScript('restore', [fileToProcess], options.verbose || false)
239239
} catch (err) {
240240
const error = err as Error
241241
spinner.fail(`Error processing ${relativePath}: ${error.message}`)
242242
process.exitCode = 1
243243

244244
// Still try to restore Liquid references on error
245245
try {
246-
runResolveLiquid('restore', [fileToProcess], false)
246+
runLiquidTagsScript('restore', [fileToProcess], false)
247247
} catch (restoreError) {
248248
// Log restore failures in verbose mode for debugging
249249
if (options.verbose) {
@@ -275,35 +275,32 @@ program
275275
program.parse(process.argv)
276276

277277
/**
278-
* Run resolve-liquid command on specified file paths
278+
* Run liquid-tags command on specified file paths
279279
*/
280-
function runResolveLiquid(
281-
command: 'resolve' | 'restore',
280+
function runLiquidTagsScript(
281+
command: 'expand' | 'restore',
282282
filePaths: string[],
283283
verbose: boolean = false,
284284
): void {
285285
const args = [command, '--paths', ...filePaths]
286-
if (command === 'resolve') {
287-
args.push('--recursive')
288-
}
289286
if (verbose) {
290287
args.push('--verbose')
291288
}
292289

293290
try {
294-
// Run resolve-liquid via tsx
295-
const resolveLiquidPath = path.join(
291+
// Run liquid-tags script via tsx
292+
const liquidTagsScriptPath = path.join(
296293
process.cwd(),
297-
'src/content-render/scripts/resolve-liquid.ts',
294+
'src/content-render/scripts/liquid-tags.ts',
298295
)
299-
execFileSync('npx', ['tsx', resolveLiquidPath, ...args], {
296+
execFileSync('npx', ['tsx', liquidTagsScriptPath, ...args], {
300297
stdio: verbose ? 'inherit' : 'pipe',
301298
})
302299
} catch (error) {
303300
if (verbose) {
304-
console.error(`Error running resolve-liquid ${command}:`, error)
301+
console.error(`Error running liquid-tags ${command}:`, error)
305302
}
306-
// Don't fail the entire process if resolve-liquid fails
303+
// Don't fail the entire process if liquid-tags fails
307304
}
308305
}
309306

0 commit comments

Comments
 (0)