@tasksai/install 0.1.19 → 0.1.20
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 +1 -1
- package/src/index.js +11 -3
package/package.json
CHANGED
package/src/index.js
CHANGED
|
@@ -315,11 +315,11 @@ async function doctor(options, {
|
|
|
315
315
|
}
|
|
316
316
|
|
|
317
317
|
const productId = String(vertical.product_id || options.productId || "").trim().toLowerCase();
|
|
318
|
-
if (productId
|
|
318
|
+
if (!sameProductId(productId, options.productId)) {
|
|
319
319
|
problems.push(`Installed product ${vertical.product_id} does not match requested product ${options.productId}`);
|
|
320
320
|
}
|
|
321
321
|
const configuredProductId = firstValue(process.env.TASKSAI_PRODUCT_ID, env.TASKSAI_PRODUCT_ID);
|
|
322
|
-
if (configuredProductId && configuredProductId
|
|
322
|
+
if (configuredProductId && !sameProductId(configuredProductId, productId)) {
|
|
323
323
|
problems.push(`Runtime product ${configuredProductId} does not match installed product ${productId}`);
|
|
324
324
|
}
|
|
325
325
|
|
|
@@ -367,7 +367,7 @@ async function doctor(options, {
|
|
|
367
367
|
const licensedProduct = String(account?.product_id || account?.product?.product_id || "").trim().toLowerCase();
|
|
368
368
|
if (!licensedProduct) {
|
|
369
369
|
problems.push("License health response did not identify a product");
|
|
370
|
-
} else if (licensedProduct
|
|
370
|
+
} else if (!sameProductId(licensedProduct, productId)) {
|
|
371
371
|
problems.push(`License is for ${licensedProduct}, not ${productId}`);
|
|
372
372
|
}
|
|
373
373
|
} catch (error) {
|
|
@@ -935,6 +935,14 @@ function sameRepository(left, right) {
|
|
|
935
935
|
=== String(right || "").replace(/\.git$/i, "").replace(/\/$/, "").toLowerCase();
|
|
936
936
|
}
|
|
937
937
|
|
|
938
|
+
function sameProductId(left, right) {
|
|
939
|
+
const normalize = (value) => {
|
|
940
|
+
const productId = String(value || "").trim().toLowerCase();
|
|
941
|
+
return productId === "lawtasksai" ? "law" : productId;
|
|
942
|
+
};
|
|
943
|
+
return normalize(left) === normalize(right);
|
|
944
|
+
}
|
|
945
|
+
|
|
938
946
|
function getInstaller(manifest) {
|
|
939
947
|
if (manifest.installer?.npm_exec) return manifest.installer.npm_exec;
|
|
940
948
|
if (manifest.installer?.npx) return manifest.installer.npx;
|