mirror of
https://github.com/codex-storage/cli.git
synced 2025-02-28 16:40:43 +00:00
checking binary installation before running
This commit is contained in:
parent
3af99c4691
commit
faa277cb39
BIN
codex-v0.1.9-darwin-arm64
Executable file
BIN
codex-v0.1.9-darwin-arm64
Executable file
Binary file not shown.
BIN
codex-v0.1.9-darwin-arm64.tar.gz
Normal file
BIN
codex-v0.1.9-darwin-arm64.tar.gz
Normal file
Binary file not shown.
1
codex-v0.1.9-darwin-arm64.tar.gz.sha256
Normal file
1
codex-v0.1.9-darwin-arm64.tar.gz.sha256
Normal file
@ -0,0 +1 @@
|
||||
c1a32dc73c6b29eaf462442d93e3f657ef8076e84480409d6c40c64fa3e96bc4 codex-v0.1.9-darwin-arm64.tar.gz
|
17
index.js
17
index.js
@ -226,7 +226,24 @@ async function isNodeRunning() {
|
||||
}
|
||||
}
|
||||
|
||||
async function isCodexInstalled() {
|
||||
try {
|
||||
await runCommand('codex --version');
|
||||
return true;
|
||||
} catch (error) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
async function runCodex() {
|
||||
// First check if Codex is installed
|
||||
const isInstalled = await isCodexInstalled();
|
||||
if (!isInstalled) {
|
||||
console.log(showErrorMessage('Codex is not installed. Please install Codex first using option 1 from the main menu.'));
|
||||
await showNavigationMenu();
|
||||
return;
|
||||
}
|
||||
|
||||
const nodeAlreadyRunning = await isNodeRunning();
|
||||
|
||||
if (nodeAlreadyRunning) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user