@weave-tools/weave-it 0.1.3 → 0.1.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/dist/cli.js CHANGED
@@ -1155,13 +1155,17 @@ async function installArtifact(cwd, agent, artifact, manifest, now) {
1155
1155
  }
1156
1156
  const currentHash = hashContent(await readFile5(artifact.destination, "utf8"));
1157
1157
  const entry = getManifestEntry(manifest, agent, artifact.kind, artifact.name);
1158
+ if (currentHash === artifact.hash) {
1159
+ setManifestEntry(manifest, agent, artifact, relativePath, now);
1160
+ return result(agent, artifact, relativePath, "unchanged", `${artifact.name} ${artifact.kind} already installed for ${agent}`);
1161
+ }
1158
1162
  if (entry && currentHash !== entry.installed_hash) {
1159
1163
  return result(agent, artifact, relativePath, "modified", `Skipped modified ${artifact.name} ${artifact.kind} for ${agent}`);
1160
1164
  }
1161
1165
  if (!entry && currentHash !== artifact.hash) {
1162
1166
  return result(agent, artifact, relativePath, "modified", `Skipped existing ${artifact.name} ${artifact.kind} for ${agent}`);
1163
1167
  }
1164
- if (entry && currentHash === entry.installed_hash && currentHash !== artifact.hash) {
1168
+ if (entry && currentHash === entry.installed_hash) {
1165
1169
  await writeFile3(artifact.destination, artifact.content);
1166
1170
  setManifestEntry(manifest, agent, artifact, relativePath, now);
1167
1171
  return result(agent, artifact, relativePath, "updated", `Updated ${artifact.name} ${artifact.kind} for ${agent}`);
@@ -1182,13 +1186,13 @@ async function updateArtifact(cwd, agent, artifact, manifest, now) {
1182
1186
  return result(agent, artifact, relativePath, "missing", `Missing ${artifact.name} ${artifact.kind} for ${agent}`);
1183
1187
  }
1184
1188
  const currentHash = hashContent(await readFile5(artifact.destination, "utf8"));
1185
- if (!entry || currentHash !== entry.installed_hash) {
1186
- return result(agent, artifact, relativePath, "modified", `Skipped modified ${artifact.name} ${artifact.kind} for ${agent}`);
1187
- }
1188
1189
  if (currentHash === artifact.hash) {
1189
1190
  setManifestEntry(manifest, agent, artifact, relativePath, now);
1190
1191
  return result(agent, artifact, relativePath, "unchanged", `${artifact.name} ${artifact.kind} already up to date for ${agent}`);
1191
1192
  }
1193
+ if (!entry || currentHash !== entry.installed_hash) {
1194
+ return result(agent, artifact, relativePath, "modified", `Skipped modified ${artifact.name} ${artifact.kind} for ${agent}`);
1195
+ }
1192
1196
  await writeFile3(artifact.destination, artifact.content);
1193
1197
  setManifestEntry(manifest, agent, artifact, relativePath, now);
1194
1198
  return result(agent, artifact, relativePath, "updated", `Updated ${artifact.name} ${artifact.kind} for ${agent}`);
@@ -3086,7 +3090,7 @@ function getNpmVersionCachePath(env = process.env) {
3086
3090
  }
3087
3091
 
3088
3092
  // src/lib/npm-version.ts
3089
- var NPM_REGISTRY_URL = "https://registry.npmjs.org/weave-it/latest";
3093
+ var NPM_REGISTRY_URL = "https://registry.npmjs.org/@weave-tools%2fweave-it/latest";
3090
3094
  var FETCH_TIMEOUT_MS = 3e3;
3091
3095
  var CACHE_TTL_MS = 24 * 60 * 60 * 1e3;
3092
3096
  async function getNpmVersionInfo(options) {