Skip to content

Commit

Permalink
chore: format
Browse files Browse the repository at this point in the history
  • Loading branch information
gabrielmpinto committed Oct 31, 2024
1 parent 359d4ee commit 9916bcc
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 10 deletions.
7 changes: 5 additions & 2 deletions src/commands/ipfs/add.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
import fs from 'node:fs';

import { getFleekXyzIpfsGatewayUrl, getPrivateIpfsGatewayUrl } from '@fleek-platform/utils-ipfs';
import {
getFleekXyzIpfsGatewayUrl,
getPrivateIpfsGatewayUrl,
} from '@fleek-platform/utils-ipfs';

import { output } from '../../cli';
import type { SdkGuardedFunction } from '../../guards/types';
Expand Down Expand Up @@ -56,7 +59,7 @@ const addAction: SdkGuardedFunction<AddActionArgs> = async ({ sdk, args }) => {
getPrivateIpfsGatewayUrl({
hostname: privateGatewayDomain.hostname,
hash,
})
}),
);
}
};
Expand Down
16 changes: 11 additions & 5 deletions src/commands/storage/add.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
import { existsSync, promises as fs } from 'node:fs';
import { basename } from 'node:path';

import { getFleekXyzIpfsGatewayUrl, getPrivateIpfsGatewayUrl } from '@fleek-platform/utils-ipfs';
import {
getFleekXyzIpfsGatewayUrl,
getPrivateIpfsGatewayUrl,
} from '@fleek-platform/utils-ipfs';
import cliProgress from 'cli-progress';
import { filesFromPaths } from 'files-from-path';

Expand All @@ -17,7 +20,9 @@ type AddStorageActionArgs = {
path: string;
};

export const addStorageAction: SdkGuardedFunction<AddStorageActionArgs> = async ({ sdk, args }) => {
export const addStorageAction: SdkGuardedFunction<
AddStorageActionArgs
> = async ({ sdk, args }) => {
if (!existsSync(args.path)) {
output.error(t('filePathNotFound', { path: args.path }));

Expand All @@ -26,9 +31,10 @@ export const addStorageAction: SdkGuardedFunction<AddStorageActionArgs> = async

const progressBar = new cliProgress.SingleBar(
{
format: 'Upload Progress [{bar}] {percentage}% | ETA: {eta}s | {value}/{total}',
format:
'Upload Progress [{bar}] {percentage}% | ETA: {eta}s | {value}/{total}',
},
cliProgress.Presets.shades_grey
cliProgress.Presets.shades_grey,
);
const directoryName = basename(args.path);
const files: FileLike[] = await filesFromPaths([args.path]);
Expand Down Expand Up @@ -79,7 +85,7 @@ export const addStorageAction: SdkGuardedFunction<AddStorageActionArgs> = async
getPrivateIpfsGatewayUrl({
hostname: privateGatewayDomain.hostname,
hash,
})
}),
);
}

Expand Down
12 changes: 9 additions & 3 deletions src/commands/storage/utils/CreateOutputTable.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
import type { FleekSdk, StoragePin } from '@fleek-platform/sdk/node';
import { getFleekXyzIpfsGatewayUrl, getPrivateIpfsGatewayUrl } from '@fleek-platform/utils-ipfs';
import {
getFleekXyzIpfsGatewayUrl,
getPrivateIpfsGatewayUrl,
} from '@fleek-platform/utils-ipfs';

import { getAllActivePrivateGatewayDomains } from '../../gateways/utils/getAllPrivateGatewayDomains';

Expand All @@ -16,7 +19,10 @@ type TableCoulmns = {
link: string;
};

export const createOutputTable = async ({ sdk, storage }: CreateOutputTableArgs): Promise<TableCoulmns[]> => {
export const createOutputTable = async ({
sdk,
storage,
}: CreateOutputTableArgs): Promise<TableCoulmns[]> => {
const privateGatewayDomains = await getAllActivePrivateGatewayDomains({
sdk,
});
Expand All @@ -29,7 +35,7 @@ export const createOutputTable = async ({ sdk, storage }: CreateOutputTableArgs)
getPrivateIpfsGatewayUrl({
hostname: privateGatewayDomain.hostname,
hash: s.cid,
})
}),
)
: [getFleekXyzIpfsGatewayUrl(s.cid)];

Expand Down

0 comments on commit 9916bcc

Please sign in to comment.