mirror of
https://github.com/FranP-code/create-better-t-stack.git
synced 2025-10-12 23:52:15 +00:00
add express, automated mongodb atlas setup, fix stack architech
This commit is contained in:
16
apps/cli/src/utils/command-exists.ts
Normal file
16
apps/cli/src/utils/command-exists.ts
Normal file
@@ -0,0 +1,16 @@
|
||||
import { execa } from "execa";
|
||||
|
||||
export async function commandExists(command: string): Promise<boolean> {
|
||||
try {
|
||||
const isWindows = process.platform === "win32";
|
||||
if (isWindows) {
|
||||
const result = await execa("where", [command]);
|
||||
return result.exitCode === 0;
|
||||
}
|
||||
|
||||
const result = await execa("which", [command]);
|
||||
return result.exitCode === 0;
|
||||
} catch {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user