mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-03-10 14:10:37 -07:00
fix: Bundle default policies for npx distribution (#14457)
This commit is contained in:
@@ -31,10 +31,26 @@ if (!existsSync(bundleDir)) {
|
||||
mkdirSync(bundleDir);
|
||||
}
|
||||
|
||||
// Find and copy all .sb files from packages to the root of the bundle directory
|
||||
// 1. Copy Sandbox definitions (.sb)
|
||||
const sbFiles = glob.sync('packages/**/*.sb', { cwd: root });
|
||||
for (const file of sbFiles) {
|
||||
copyFileSync(join(root, file), join(bundleDir, basename(file)));
|
||||
}
|
||||
|
||||
// 2. Copy Policy definitions (.toml)
|
||||
const policyDir = join(bundleDir, 'policies');
|
||||
if (!existsSync(policyDir)) {
|
||||
mkdirSync(policyDir);
|
||||
}
|
||||
|
||||
// Locate policy files specifically in the core package
|
||||
const policyFiles = glob.sync('packages/core/src/policy/policies/*.toml', {
|
||||
cwd: root,
|
||||
});
|
||||
|
||||
for (const file of policyFiles) {
|
||||
copyFileSync(join(root, file), join(policyDir, basename(file)));
|
||||
}
|
||||
|
||||
console.log(`Copied ${policyFiles.length} policy files to bundle/policies/`);
|
||||
console.log('Assets copied to bundle/');
|
||||
|
||||
Reference in New Issue
Block a user