mirror of
https://github.com/FranP-code/create-better-t-stack.git
synced 2025-10-12 23:52:15 +00:00
fix turso cli issue
This commit is contained in:
20
apps/cli/src/utils/turso-cli.ts
Normal file
20
apps/cli/src/utils/turso-cli.ts
Normal file
@@ -0,0 +1,20 @@
|
||||
import { execa } from "execa";
|
||||
|
||||
export async function isTursoInstalled() {
|
||||
try {
|
||||
await execa("turso", ["--version"]);
|
||||
return true;
|
||||
} catch {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
export async function isTursoLoggedIn() {
|
||||
try {
|
||||
const output = await execa("turso", ["auth", "whoami"]);
|
||||
console.log(output.stdout.includes("You are not logged in"));
|
||||
return !output.stdout.includes("You are not logged in");
|
||||
} catch {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user