fix self-reference in build script (#5548)

This commit is contained in:
Olcan 2025-08-04 18:12:21 -07:00 committed by GitHub
parent 99ba2f6424
commit 11ecf6fc86
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 3 additions and 2 deletions

View File

@ -19,11 +19,12 @@
import { execSync } from 'child_process'; import { execSync } from 'child_process';
import { existsSync, mkdirSync, writeFileSync } from 'fs'; import { existsSync, mkdirSync, writeFileSync } from 'fs';
import { dirname, join } from 'path'; import { dirname, join, relative } from 'path';
import { fileURLToPath } from 'url'; import { fileURLToPath } from 'url';
const __dirname = dirname(fileURLToPath(import.meta.url)); const __dirname = dirname(fileURLToPath(import.meta.url));
const root = join(__dirname, '..'); const root = join(__dirname, '..');
const scriptPath = relative(root, fileURLToPath(import.meta.url));
const generatedDir = join(root, 'packages/cli/src/generated'); const generatedDir = join(root, 'packages/cli/src/generated');
const gitCommitFile = join(generatedDir, 'git-commit.ts'); const gitCommitFile = join(generatedDir, 'git-commit.ts');
let gitCommitInfo = 'N/A'; let gitCommitInfo = 'N/A';
@ -55,7 +56,7 @@ const fileContent = `/**
* SPDX-License-Identifier: Apache-2.0 * SPDX-License-Identifier: Apache-2.0
*/ */
// This file is auto-generated by the build script (scripts/build.js) // This file is auto-generated by the build script (${scriptPath})
// Do not edit this file manually. // Do not edit this file manually.
export const GIT_COMMIT_INFO = '${gitCommitInfo}'; export const GIT_COMMIT_INFO = '${gitCommitInfo}';
`; `;