fundamentum-cli 0.1.1 → 0.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/install.js +12 -1
  2. package/package.json +6 -6
package/install.js CHANGED
@@ -29,6 +29,17 @@ const ARCH_MAP = {
29
29
  arm64: "arm64",
30
30
  };
31
31
 
32
+ function getPackageVersion(pkg) {
33
+ const version = pkg.version;
34
+
35
+ // Validate semver format to prevent URL injection
36
+ if (!/^\d+\.\d+\.\d+(-[a-zA-Z0-9.]+)?(\+[a-zA-Z0-9.]+)?$/.test(version)) {
37
+ throw new Error(`Invalid version format: ${version}`);
38
+ }
39
+
40
+ return version;
41
+ }
42
+
32
43
  function getArchiveName(version, platform, arch) {
33
44
  const os = PLATFORM_MAP[platform];
34
45
  const cpu = ARCH_MAP[arch];
@@ -178,7 +189,7 @@ async function main() {
178
189
  const pkg = JSON.parse(
179
190
  fs.readFileSync(path.join(__dirname, "package.json"), "utf8")
180
191
  );
181
- const version = pkg.version;
192
+ const version = getPackageVersion(pkg);
182
193
  if (version === "0.0.0") {
183
194
  console.error("fundamentum: skipping binary download for development version");
184
195
  return;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fundamentum-cli",
3
- "version": "0.1.1",
3
+ "version": "0.1.2",
4
4
  "description": "Bootstrap and harden GitHub repos for OSS collaboration — community files, branch protection, security features, and starter workflows in one command.",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -57,10 +57,10 @@
57
57
  "bin/"
58
58
  ],
59
59
  "binaryChecksums": {
60
- "fundamentum_0.1.1_darwin_amd64.tar.gz": "48244bc656488ac9b465419a31dda5e3b76b46dc479b45682c039067dbc62b36",
61
- "fundamentum_0.1.1_darwin_arm64.tar.gz": "142893eac98b77d164945770d408c528f0efc5b30911581b3bc4da20d12914b2",
62
- "fundamentum_0.1.1_linux_amd64.tar.gz": "5a2339bf48a2bd4799fa4a4f547b90e50b698b50b93df519db5495fdfb22b60f",
63
- "fundamentum_0.1.1_linux_arm64.tar.gz": "1146ba44cb6d610230a1ba201e548df67c765d0beec60a3a60cfbc97151372ca",
64
- "fundamentum_0.1.1_windows_amd64.zip": "13c689d036cffe2e46f0d3a21780441b4ef099cbef17f424e2549e20c8d72583"
60
+ "fundamentum_0.1.2_darwin_amd64.tar.gz": "3a80afe84553b993fed503fcceee2d206c57dc023ad93c719f37837903bc53e4",
61
+ "fundamentum_0.1.2_darwin_arm64.tar.gz": "6554bb025c3d166c12fe50dde2209546b23c42822ffebfaf34c14528ecd335a2",
62
+ "fundamentum_0.1.2_linux_amd64.tar.gz": "3e827ed72c7ff851fa01f7b834dbaf1962bece2caf862154c3f62cf27bc66262",
63
+ "fundamentum_0.1.2_linux_arm64.tar.gz": "0c5dd67a622553124bbfe6d480e691d895dab1fddf0461e9f42f81db87e9d0d4",
64
+ "fundamentum_0.1.2_windows_amd64.zip": "5c0867554b208e6bf502eee9fb5897a67ae94d88ab41031a5f70169fabe9de08"
65
65
  }
66
66
  }