Skip to content

Commit dfd0ca3

Browse files
committed
fix: show disk usage
1 parent 609cc65 commit dfd0ca3

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

src/commands/files.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -452,7 +452,6 @@ export async function getInfo(args = []) {
452452
console.log(chalk.cyan(`Writable: `) + chalk.white(data.writable ? 'Yes' : 'No'));
453453
console.log(chalk.cyan(`Owner: `) + chalk.white(data.owner.username));
454454
console.log(chalk.dim('----------------------------------------'));
455-
console.log(chalk.green('Done.'));
456455
} else {
457456
console.error(chalk.red('Unable to get stat info. Please check your credentials.'));
458457
}
@@ -523,7 +522,6 @@ export async function getDiskUsage(body = null) {
523522
});
524523

525524
const data = await response.json();
526-
console.log(data);
527525
if (response.ok && data) {
528526
showDiskSpaceUsage(data);
529527
} else {
@@ -784,7 +782,7 @@ export async function uploadFile(args = []) {
784782
// Step 2: Check disk space
785783
const dfResponse = await fetch(`${API_BASE}/df`, {
786784
method: 'POST',
787-
headers: getHeaders(), // Use a dummy boundary for non-multipart requests
785+
headers: getHeaders(),
788786
body: null
789787
});
790788

src/commons.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import chalk from 'chalk';
22
import { getAuthToken } from './commands/auth.js';
3+
import { formatSize } from './utils.js';
34
import { readFile } from 'fs/promises';
45
import { fileURLToPath } from 'url';
56
import { dirname, join } from 'path';
@@ -100,7 +101,6 @@ export function showDiskSpaceUsage(data) {
100101
// format the usagePercentage with 2 decimal floating point value:
101102
console.log(chalk.cyan(`Usage Percentage: `) + chalk.white(`${usagePercentage.toFixed(2)}%`));
102103
console.log(chalk.dim('----------------------------------------'));
103-
console.log(chalk.green('Done.'));
104104
}
105105

106106
/**

0 commit comments

Comments
 (0)