diff --git a/.github/workflows/webpack.yml b/.github/workflows/webpack.yml deleted file mode 100644 index cd19695e5f9..00000000000 --- a/.github/workflows/webpack.yml +++ /dev/null @@ -1,28 +0,0 @@ -name: NodeJS with Webpack - -on: - push: - branches: ['main'] - pull_request: - branches: ['main'] - -jobs: - build: - runs-on: ubuntu-latest - - strategy: - matrix: - node-version: [18.x, 20.x, 22.x] - - steps: - - uses: actions/checkout@v4 - - - name: Use Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v4 - with: - node-version: ${{ matrix.node-version }} - - - name: Build - run: | - npm install - npx webpack diff --git a/packages/core/src/utils/filesearch/fileSearch.ts b/packages/core/src/utils/filesearch/fileSearch.ts index 480d5815aa2..0874c09e2ad 100644 --- a/packages/core/src/utils/filesearch/fileSearch.ts +++ b/packages/core/src/utils/filesearch/fileSearch.ts @@ -109,7 +109,7 @@ export class FileSearch { * before performing any searches. */ async initialize(): Promise { - this.loadIgnoreRules(); + await this.loadIgnoreRules(); await this.crawlFiles(); this.buildResultCache(); } @@ -199,18 +199,38 @@ export class FileSearch { * Loads ignore rules from .gitignore and .geminiignore files, and applies * any additional ignore directories specified in the options. */ - private loadIgnoreRules(): void { + private async loadIgnoreRules(): Promise { + const reads: Array< + Promise<{ + type: 'gitignore' | 'geminiignore'; + content: string | null; + }> + > = []; + if (this.options.useGitignore) { const gitignorePath = path.join(this.absoluteDir, '.gitignore'); - if (fs.existsSync(gitignorePath)) { - this.ignore.add(fs.readFileSync(gitignorePath, 'utf8')); - } + reads.push( + fs.promises + .readFile(gitignorePath, 'utf8') + .then((content) => ({ type: 'gitignore' as const, content })) + .catch(() => ({ type: 'gitignore' as const, content: null })), + ); } if (this.options.useGeminiignore) { const geminiignorePath = path.join(this.absoluteDir, '.geminiignore'); - if (fs.existsSync(geminiignorePath)) { - this.ignore.add(fs.readFileSync(geminiignorePath, 'utf8')); + reads.push( + fs.promises + .readFile(geminiignorePath, 'utf8') + .then((content) => ({ type: 'geminiignore' as const, content })) + .catch(() => ({ type: 'geminiignore' as const, content: null })), + ); + } + + const results = await Promise.all(reads); + for (const res of results) { + if (res.content !== null) { + this.ignore.add(res.content); } } diff --git a/scripts/generate-git-commit-info.js b/scripts/generate-git-commit-info.js index 7c4871ec4b9..d5a0da93cc2 100644 --- a/scripts/generate-git-commit-info.js +++ b/scripts/generate-git-commit-info.js @@ -50,6 +50,20 @@ const fileContent = `/** * SPDX-License-Identifier: Apache-2.0 */ +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + // This file is auto-generated by the build script (${scriptPath}) // Do not edit this file manually. export const GIT_COMMIT_INFO = '${gitCommitInfo}';