Skip to content

Commit 6e84dd2

Browse files
committed
return err
1 parent 7684897 commit 6e84dd2

2 files changed

Lines changed: 14 additions & 13 deletions

File tree

src/helpers.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { ethers, hexlify, Signer } from "ethers";
1+
import { ethers, hexlify, Signer, toBeHex } from "ethers";
22
import fetch from "cross-fetch";
33
import { promises as fs, readFileSync } from "fs";
44
import * as path from "path";
@@ -182,7 +182,7 @@ export async function updateAssetMetadata(
182182
0,
183183
oceanNodeUrl,
184184
"",
185-
hexlify(flags),
185+
toBeHex(flags),
186186
metadata,
187187
validateResult.hash
188188
);

test/util.ts

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ import { exec } from "child_process";
22
import path from "path";
33
import util from "util";
44

5-
import { dirname } from 'path'
6-
import { fileURLToPath } from 'url'
5+
import { dirname } from 'path';
6+
import { fileURLToPath } from 'url';
77

88

99
export const execPromise = util.promisify(exec);
@@ -14,13 +14,14 @@ export const __dirname = dirname(__filename)
1414

1515
export const projectRoot = path.resolve(__dirname, "..");
1616
export const runCommand = async (command: string): Promise<string> => {
17-
console.log(`\n[CMD]: ${command}`);
18-
try {
19-
const { stdout } = await execPromise(command, { cwd: projectRoot });
20-
console.log(`[OUTPUT]:\n${stdout}`);
21-
return stdout;
22-
} catch (error: any) {
23-
console.error(`[ERROR]:\n${error.stderr || error.message}`);
24-
throw error;
25-
}
17+
console.log(`\n[CMD]: ${command}`);
18+
try {
19+
const { stdout } = await execPromise(command, { cwd: projectRoot });
20+
console.log(`[OUTPUT]:\n${stdout}`);
21+
return stdout;
22+
} catch (error: any) {
23+
console.log({ error })
24+
console.error(`[ERROR]:\n${error.stderr || error.message}`);
25+
throw error;
26+
}
2627
};

0 commit comments

Comments
 (0)