mirror of
https://github.com/codex-storage/cli.git
synced 2025-02-28 16:40:43 +00:00
Fixes local-datasets lookup
This commit is contained in:
parent
b9d6fd70b9
commit
8fa5705817
@ -154,11 +154,10 @@ export async function showLocalFiles(config, showNavigationMenu) {
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
const spinner = createSpinner('Fetching local files...').start();
|
const spinner = createSpinner('Fetching local files...').start();
|
||||||
const filesResponse = await runCommand(`curl http://localhost:${config.ports.apiPort}/api/codex/v1/data -w \'\\n\'`);
|
const filesResponse = await axios.get(`http://localhost:${config.ports.apiPort}/api/codex/v1/data`);
|
||||||
|
const filesData = filesResponse.data;
|
||||||
spinner.success();
|
spinner.success();
|
||||||
|
|
||||||
const filesData = JSON.parse(filesResponse);
|
|
||||||
|
|
||||||
if (filesData.content && filesData.content.length > 0) {
|
if (filesData.content && filesData.content.length > 0) {
|
||||||
console.log(showInfoMessage(`Found ${filesData.content.length} local file(s)`));
|
console.log(showInfoMessage(`Found ${filesData.content.length} local file(s)`));
|
||||||
|
|
||||||
@ -187,6 +186,8 @@ export async function showLocalFiles(config, showNavigationMenu) {
|
|||||||
}
|
}
|
||||||
));
|
));
|
||||||
});
|
});
|
||||||
|
} else {
|
||||||
|
console.log(showInfoMessage("Node contains no datasets."));
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.log(showErrorMessage(`Failed to fetch local files: ${error.message}`));
|
console.log(showErrorMessage(`Failed to fetch local files: ${error.message}`));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user