@orxataguy/tyr 1.0.10-beta.7 → 1.0.10-beta.9
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/lib/SetupManager.ts +5 -8
package/package.json
CHANGED
package/src/lib/SetupManager.ts
CHANGED
|
@@ -41,10 +41,9 @@ export class SetupManager {
|
|
|
41
41
|
: [['apk', 'apk'], ['apt-get', 'apt'], ['brew', 'brew'], ['dnf', 'dnf']];
|
|
42
42
|
|
|
43
43
|
for (const [bin, name] of candidates) {
|
|
44
|
-
const found = await this.shell.exec(
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
if (found.trim() === 'yes') return name;
|
|
44
|
+
const found = await this.shell.exec(`which ${bin} >/dev/null 2>&1`)
|
|
45
|
+
.then(() => true).catch(() => false);
|
|
46
|
+
if (found) return name;
|
|
48
47
|
}
|
|
49
48
|
return 'unknown';
|
|
50
49
|
}
|
|
@@ -85,10 +84,8 @@ export class SetupManager {
|
|
|
85
84
|
* if (!await setup.binExists('docker')) fail('Docker is required.');
|
|
86
85
|
*/
|
|
87
86
|
public async binExists(bin: string): Promise<boolean> {
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
).catch(() => 'no');
|
|
91
|
-
return result.trim() === 'yes';
|
|
87
|
+
return this.shell.exec(`which ${bin} >/dev/null 2>&1`)
|
|
88
|
+
.then(() => true).catch(() => false);
|
|
92
89
|
}
|
|
93
90
|
|
|
94
91
|
// ── docker-compose file introspection ───────────────────────────────────
|