From 50822e147b5ef9b26ad3067a82773584e69787ea Mon Sep 17 00:00:00 2001 From: Jonas Daniels Date: Mon, 19 Sep 2022 12:50:29 -0700 Subject: [PATCH] init fixing cli --- packages/cli/src/common/processor.ts | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) diff --git a/packages/cli/src/common/processor.ts b/packages/cli/src/common/processor.ts index 22b00c580a2..76edfff1178 100644 --- a/packages/cli/src/common/processor.ts +++ b/packages/cli/src/common/processor.ts @@ -142,10 +142,9 @@ export async function processProject( const metadataURIs = await Promise.all( selectedContracts.map(async (c) => { logger.debug(`Uploading ${c.name}...`); - const hash = await storage.upload(c.metadata, { + return await storage.upload(c.metadata, { uploadWithoutDirectory: true, }); - return `ipfs://${hash}`; }), ); @@ -194,18 +193,9 @@ export async function processProject( } export function getUrl(hashes: string[], command: string) { - let url; - if (hashes.length === 1) { - url = new URL( - THIRDWEB_URL + - `/contracts/${command}/` + - encodeURIComponent(hashes[0].replace("ipfs://", "")), - ); - } else { - url = new URL(THIRDWEB_URL + "/contracts/" + command); - for (let hash of hashes) { - url.searchParams.append("ipfs", hash.replace("ipfs://", "")); - } + const url = new URL(THIRDWEB_URL + "/contracts/" + command); + for (let hash of hashes) { + url.searchParams.append("ipfs", hash.replace("ipfs://", "")); } return url; }