wip: testing drive iteration

This commit is contained in:
thatben 2025-02-20 09:23:18 +01:00
parent 79cb99749b
commit dc42c557fb
No known key found for this signature in database
GPG Key ID: 62C543548433D43E
3 changed files with 37 additions and 1 deletions

View File

@ -24,6 +24,7 @@
"inquirer": "^9.2.12",
"mime-types": "^2.1.35",
"nanospinner": "^1.1.0",
"fs-extra": "^11.3.0"
"fs-extra": "^11.3.0",
"fs-filesystem": "^2.1.2"
}
}

View File

@ -11,6 +11,7 @@ import { runCodex, checkNodeStatus } from './handlers/nodeHandlers.js';
import { showInfoMessage } from './utils/messages.js';
import { loadConfig } from './services/config.js';
import { showConfigMenu } from './configmenu.js';
import {filesystemSync} from 'fs-filesystem';
async function showNavigationMenu() {
console.log('\n')
@ -52,6 +53,20 @@ function handleExit() {
}
export async function main() {
const result = filesystemSync();
console.log('devices', JSON.stringify(result));
Object.keys(result).forEach(function(key) {
var val = result[key];
val.volumes.forEach(function(volume) {
console.log("mounting point: " + volume.mountPoint);
});
});
return;
const commandArgs = parseCommandLineArgs();
if (commandArgs) {
switch (commandArgs.command) {

View File

@ -3,6 +3,7 @@ import inquirer from 'inquirer';
import boxen from 'boxen';
import chalk from 'chalk';
import fs from 'fs';
import { filesystemSync } from 'fs-filesystem';
function showMsg(msg) {
console.log(boxen(chalk.white(msg), {
@ -14,6 +15,16 @@ function showMsg(msg) {
}));
}
// function getAvailableRoots() {
// const platform = os.platform();
// if (platform === 'win32') {
// const result = await runCommand('for /f "delims=" %a in (\'curl -s --ssl-reqd ip.codex.storage\') do @echo %a');
// nat = result.trim();
// } else {
// nat = await runCommand('curl -s https://ip.codex.storage');
// }
// }
function splitPath(str) {
return str.replaceAll("\\", "/").split("/");
}
@ -43,6 +54,15 @@ function combineWith(parts, extra) {
function showCurrent(currentPath) {
const len = currentPath.length;
showMsg(`Current path: [${len}]\n` + combine(currentPath));
if (len < 2) {
showMsg(
'Warning - Known issue:\n' +
'Path selection does not work in root paths on some platforms.\n' +
'Use "Enter path" or "Create new folder" to navigate and create folders\n' +
'if this is the case for you.'
);
}
}
async function showMain(currentPath) {