diff options
| author | matt korwel <[email protected]> | 2025-07-03 22:57:01 -0500 |
|---|---|---|
| committer | GitHub <[email protected]> | 2025-07-04 03:57:01 +0000 |
| commit | d43ea268b01e80166ca9325bf174a9796105715f (patch) | |
| tree | b9af69c504a328074fcb4bff8165ede0460d05d7 /scripts/bind_package_version.js | |
| parent | 32db5ba0e1b7628fa6714bea8532377641b1af18 (diff) | |
Releasing: Utilizing Github Actions and Tagging for release. (#2852)
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Co-authored-by: N. Taylor Mullen <[email protected]>
Diffstat (limited to 'scripts/bind_package_version.js')
| -rw-r--r-- | scripts/bind_package_version.js | 42 |
1 files changed, 0 insertions, 42 deletions
diff --git a/scripts/bind_package_version.js b/scripts/bind_package_version.js deleted file mode 100644 index 4e7a2ff7..00000000 --- a/scripts/bind_package_version.js +++ /dev/null @@ -1,42 +0,0 @@ -/** - * @license - * Copyright 2025 Google LLC - * SPDX-License-Identifier: Apache-2.0 - */ - -import fs from 'node:fs'; -import path from 'node:path'; - -// Assuming script is run from a package directory (e.g., packages/cli) -const packageDir = process.cwd(); -const rootDir = path.join(packageDir, '..', '..'); // Go up two directories to find the repo root - -function getRepoVersion() { - // Read root package.json - const rootPackageJsonPath = path.join(rootDir, 'package.json'); - const rootPackage = JSON.parse(fs.readFileSync(rootPackageJsonPath, 'utf8')); - return rootPackage.version; // This version is now expected to be the full version string -} - -const newVersion = getRepoVersion(); -console.log(`Setting package version to: ${newVersion}`); - -const packageJsonPath = path.join(packageDir, 'package.json'); - -if (fs.existsSync(packageJsonPath)) { - console.log(`Updating version for ${packageJsonPath}`); - const packageJson = JSON.parse(fs.readFileSync(packageJsonPath, 'utf8')); - packageJson.version = newVersion; - fs.writeFileSync( - packageJsonPath, - JSON.stringify(packageJson, null, 2) + '\n', - 'utf8', - ); -} else { - console.error( - `Error: package.json not found in the current directory: ${packageJsonPath}`, - ); - process.exit(1); -} - -console.log('Done.'); |
