mirror of
https://github.com/logos-storage/logos-storage-installer.git
synced 2026-01-03 05:53:06 +00:00
wip
This commit is contained in:
parent
2114d737cb
commit
9a1ce2bf52
@ -9,6 +9,7 @@ import { uploadFile, downloadFile, showLocalFiles } from './handlers/fileHandler
|
||||
import { checkCodexInstallation, installCodex, uninstallCodex } from './handlers/installationHandlers.js';
|
||||
import { runCodex, checkNodeStatus } from './handlers/nodeHandlers.js';
|
||||
import { showInfoMessage } from './utils/messages.js';
|
||||
import { getAppDataDir } from "./utils/appdata.js";
|
||||
|
||||
async function showNavigationMenu() {
|
||||
console.log('\n')
|
||||
@ -49,6 +50,10 @@ function handleExit() {
|
||||
process.exit(0);
|
||||
}
|
||||
|
||||
function getWorkingDir(commandArgs) {
|
||||
|
||||
}
|
||||
|
||||
export async function main() {
|
||||
const commandArgs = parseCommandLineArgs();
|
||||
if (commandArgs) {
|
||||
@ -69,6 +74,7 @@ export async function main() {
|
||||
try {
|
||||
while (true) {
|
||||
console.log('\n' + chalk.cyanBright(ASCII_ART));
|
||||
console.log(showInfoMessage(`Working directory: ${getAppDataDir()}`));
|
||||
|
||||
const { choice } = await inquirer.prompt([
|
||||
{
|
||||
|
||||
28
src/utils/appdata.js
Normal file
28
src/utils/appdata.js
Normal file
@ -0,0 +1,28 @@
|
||||
import path from 'path';
|
||||
|
||||
export function getAppDataDir() {
|
||||
return appData("codex-cli");
|
||||
}
|
||||
|
||||
function appData(...app) {
|
||||
let appData;
|
||||
if (process.platform === 'win32') {
|
||||
appData = path.join(process.env.APPDATA, ...app);
|
||||
} else if (process.platform === 'darwin') {
|
||||
appData = path.join(process.env.HOME, 'Library', 'Application Support', ...app);
|
||||
} else {
|
||||
appData = path.join(process.env.HOME, ...prependDot(...app));
|
||||
}
|
||||
return appData;
|
||||
}
|
||||
|
||||
function prependDot(...app) {
|
||||
return app.map((item, i) => {
|
||||
if (i === 0) {
|
||||
return `.${item}`;
|
||||
} else {
|
||||
return item;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user