Fix: Use Node.js script for cross-platform file copying in build

- Replaces the rsync command in the build_package.sh script with a
  Node.js script (copy_files.cjs) to handle copying necessary files
  (e.g., .md, .json, .sb) during the build process.
- Addresses an issue where the build would fail on systems
  that do not have rsync installed (e.g., some Windows environments or
  minimal Linux distributions) by using a Node.js script, providing a
  cross-platform solution as Node.js is already a project dependency.
- Updates the ESLint configuration to correctly lint .cjs files as
  CommonJS modules.

Fixes https://github.com/google-gemini/gemini-cli/issues/387
This commit is contained in:
Taylor Mullen
2025-05-16 13:54:54 -07:00
committed by N. Taylor Mullen
parent 8b959c2060
commit 8af970061e
3 changed files with 79 additions and 2 deletions

View File

@@ -26,8 +26,8 @@ fi
# build typescript files
tsc --build
# copy .{md,json} files (replace -q with -i to see itemized changes)
rsync -aq --delete --include='*.md' --include='*.json' --include='*.sb' --include='*/' --exclude='*' ./src/ ./dist/src/
# copy .{md,json} files
node ../../scripts/copy_files.cjs
# touch dist/.last_build
touch dist/.last_build