mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-06-19 07:46:45 -07:00
fix(build): clean dist directory before tsc build to prevent TS5055
When building multiple times consecutively, `tsc` would sometimes treat the previously generated `.d.ts` files in `dist/` as inputs, leading to the TS5055 overwrite error. Clearing the `dist` directory at the start of the build script ensures a clean slate and fixes this CI failure.
This commit is contained in:
@@ -18,7 +18,7 @@
|
||||
// limitations under the License.
|
||||
|
||||
import { execSync } from 'node:child_process';
|
||||
import { writeFileSync, existsSync, cpSync } from 'node:fs';
|
||||
import { writeFileSync, existsSync, cpSync, rmSync } from 'node:fs';
|
||||
import { join, basename } from 'node:path';
|
||||
|
||||
if (!process.cwd().includes('packages')) {
|
||||
@@ -28,6 +28,9 @@ if (!process.cwd().includes('packages')) {
|
||||
|
||||
const packageName = basename(process.cwd());
|
||||
|
||||
// Clean the dist directory to prevent TS5055 overwrite errors during consecutive builds
|
||||
rmSync(join(process.cwd(), 'dist'), { recursive: true, force: true });
|
||||
|
||||
// build typescript files
|
||||
execSync('tsc --build', { stdio: 'inherit' });
|
||||
|
||||
|
||||
Reference in New Issue
Block a user