@rstf/cli 0.1.0-alpha.3 → 0.1.0-alpha.5

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rstf/cli",
3
- "version": "0.1.0-alpha.3",
3
+ "version": "0.1.0-alpha.5",
4
4
  "description": "Project-local rstf CLI",
5
5
  "homepage": "https://github.com/rafbgarcia/rstf#readme",
6
6
  "bugs": {
@@ -39,7 +39,7 @@
39
39
  ],
40
40
  "rstf": {
41
41
  "goPackage": "github.com/rafbgarcia/rstf/cmd/rstf",
42
- "goVersion": "v0.1.0-alpha.3",
42
+ "goVersion": "v0.1.0-alpha.5",
43
43
  "repo": "rafbgarcia/rstf"
44
44
  }
45
45
  }
@@ -55,6 +55,10 @@ function sha256Hex(data) {
55
55
  return createHash("sha256").update(data).digest("hex");
56
56
  }
57
57
 
58
+ function normalizeChecksumAssetPath(assetPath) {
59
+ return path.posix.basename(assetPath.replaceAll("\\", "/"));
60
+ }
61
+
58
62
  function parseChecksums(contents) {
59
63
  const checksums = new Map();
60
64
  for (const line of contents.split(/\r?\n/)) {
@@ -66,7 +70,7 @@ function parseChecksums(contents) {
66
70
  if (!match) {
67
71
  throw new Error(`invalid checksum line: ${trimmed}`);
68
72
  }
69
- checksums.set(match[2], match[1].toLowerCase());
73
+ checksums.set(normalizeChecksumAssetPath(match[2]), match[1].toLowerCase());
70
74
  }
71
75
  return checksums;
72
76
  }
@@ -145,6 +149,7 @@ module.exports = {
145
149
  currentPackage,
146
150
  installBinary,
147
151
  normalizeTarget,
152
+ normalizeChecksumAssetPath,
148
153
  parseChecksums,
149
154
  releaseBaseURL,
150
155
  sha256Hex,