fundamentum-cli 0.1.1 → 0.1.3
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.
- package/install.js +12 -1
- 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
|
|
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.
|
|
3
|
+
"version": "0.1.3",
|
|
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.
|
|
61
|
-
"fundamentum_0.1.
|
|
62
|
-
"fundamentum_0.1.
|
|
63
|
-
"fundamentum_0.1.
|
|
64
|
-
"fundamentum_0.1.
|
|
60
|
+
"fundamentum_0.1.3_darwin_amd64.tar.gz": "90fe9056b022d0fb86e4257679a5cf41ee12641c970bb17e1788c5495ad814ca",
|
|
61
|
+
"fundamentum_0.1.3_darwin_arm64.tar.gz": "1aa6bc9c0be0e8bf9d8149cd64386353555beaf8b9582b93008d45c3324c4cdc",
|
|
62
|
+
"fundamentum_0.1.3_linux_amd64.tar.gz": "53a0b907a7ef4ac3145734f92f44557c131952cf9b7d33870f7a568989c83545",
|
|
63
|
+
"fundamentum_0.1.3_linux_arm64.tar.gz": "8d20429ea4e777d5a3ebb0454cd6594eb91f40e0745a422fc4fcd488ff4366a3",
|
|
64
|
+
"fundamentum_0.1.3_windows_amd64.zip": "711e5dc5d32ed8e0d3b03d8a9f70b78e4229f9a81b3754dbc516bd811cf869e0"
|
|
65
65
|
}
|
|
66
66
|
}
|