@bretwardjames/tw-bridge 0.7.0 → 0.7.1
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 +18 -4
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -1541,11 +1541,25 @@ function parseBackendRef(ref) {
|
|
|
1541
1541
|
}
|
|
1542
1542
|
async function resolveTaskByRef(ref) {
|
|
1543
1543
|
const config = loadConfig();
|
|
1544
|
-
const
|
|
1545
|
-
|
|
1546
|
-
)
|
|
1544
|
+
const repo = parseFlag("--repo");
|
|
1545
|
+
let backendName;
|
|
1546
|
+
if (repo) {
|
|
1547
|
+
const repoName = repo.includes("/") ? repo.split("/").pop() : repo;
|
|
1548
|
+
backendName = Object.keys(config.backends).find((name) => {
|
|
1549
|
+
const b = config.backends[name];
|
|
1550
|
+
if (b.adapter !== ref.backend && name !== ref.backend) return false;
|
|
1551
|
+
const project = b.config?.project;
|
|
1552
|
+
const cwdBase = b.config?.cwd ? path6.basename(b.config.cwd) : void 0;
|
|
1553
|
+
return project?.toLowerCase() === repoName.toLowerCase() || cwdBase?.toLowerCase() === repoName.toLowerCase();
|
|
1554
|
+
});
|
|
1555
|
+
}
|
|
1556
|
+
if (!backendName) {
|
|
1557
|
+
backendName = Object.keys(config.backends).find(
|
|
1558
|
+
(name) => name === ref.backend || config.backends[name].adapter === ref.backend
|
|
1559
|
+
);
|
|
1560
|
+
}
|
|
1547
1561
|
if (!backendName) {
|
|
1548
|
-
console.error(`No backend found matching "${ref.backend}".`);
|
|
1562
|
+
console.error(`No backend found matching "${ref.backend}"${repo ? ` for repo "${repo}"` : ""}.`);
|
|
1549
1563
|
console.error(`Configured backends: ${Object.keys(config.backends).join(", ")}`);
|
|
1550
1564
|
process.exit(1);
|
|
1551
1565
|
}
|