diff options
| author | Brandon Keiji <[email protected]> | 2025-06-26 22:36:34 +0000 |
|---|---|---|
| committer | GitHub <[email protected]> | 2025-06-26 22:36:34 +0000 |
| commit | d9892ada7f313c10f3206d286091803126f3ea72 (patch) | |
| tree | 3f1eb4281e770ee42237d91bc020aa8f29d271ea /scripts | |
| parent | 560905154c9c44b3439bf6dce20c2d741bdd73af (diff) | |
fix: add repository field to package.jsons (#2032)
Diffstat (limited to 'scripts')
| -rw-r--r-- | scripts/prepare-cli-packagejson.js | 12 | ||||
| -rw-r--r-- | scripts/prepare-core-package.js | 37 |
2 files changed, 49 insertions, 0 deletions
diff --git a/scripts/prepare-cli-packagejson.js b/scripts/prepare-cli-packagejson.js index 64c36ff0..d7960708 100644 --- a/scripts/prepare-cli-packagejson.js +++ b/scripts/prepare-cli-packagejson.js @@ -74,3 +74,15 @@ try { console.error('Error copying README.md:', err); process.exit(1); } + +// Copy README.md to packages/cli +const rootLicensePath = path.resolve(__dirname, '../LICENSE'); +const cliLicensePath = path.resolve(__dirname, '../packages/cli/LICENSE'); + +try { + fs.copyFileSync(rootLicensePath, cliLicensePath); + console.log('Copied root LICENSE to packages/cli/'); +} catch (err) { + console.error('Error copying LICENSE:', err); + process.exit(1); +} diff --git a/scripts/prepare-core-package.js b/scripts/prepare-core-package.js new file mode 100644 index 00000000..7d2e1e08 --- /dev/null +++ b/scripts/prepare-core-package.js @@ -0,0 +1,37 @@ +/** + * @license + * Copyright 2025 Google LLC + * SPDX-License-Identifier: Apache-2.0 + */ + +import fs from 'fs'; +import path from 'path'; +import { fileURLToPath } from 'url'; + +// ES module equivalent of __dirname +const __filename = fileURLToPath(import.meta.url); +const __dirname = path.dirname(__filename); + +// Copy README.md to packages/core +const rootReadmePath = path.resolve(__dirname, '../README.md'); +const coreReadmePath = path.resolve(__dirname, '../packages/core/README.md'); + +try { + fs.copyFileSync(rootReadmePath, coreReadmePath); + console.log('Copied root README.md to packages/core/'); +} catch (err) { + console.error('Error copying README.md:', err); + process.exit(1); +} + +// Copy README.md to packages/cli +const rootLicensePath = path.resolve(__dirname, '../LICENSE'); +const coreLicensePath = path.resolve(__dirname, '../packages/core/LICENSE'); + +try { + fs.copyFileSync(rootLicensePath, coreLicensePath); + console.log('Copied root LICENSE to packages/core/'); +} catch (err) { + console.error('Error copying LICENSE:', err); + process.exit(1); +} |
