Skip to content

Commit

Permalink
build after pull
Browse files Browse the repository at this point in the history
  • Loading branch information
holic committed Sep 13, 2024
1 parent a48d999 commit 48ca428
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/cli/src/commands/pull.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { Address, createClient, http } from "viem";
import chalk from "chalk";
import { WriteFileExistsError, pull } from "../pull/pull";
import path from "node:path";
import { build } from "../build";

const options = {
worldAddress: { type: "string", required: true, desc: "Remote world address" },
Expand Down Expand Up @@ -48,12 +49,13 @@ const commandModule: CommandModule<Options, Options> = {
const rootDir = process.cwd();

try {
await pull({
const { config } = await pull({
rootDir,
client,
worldAddress: opts.worldAddress as Address,
replace: opts.replace,
});
await build({ rootDir, config, foundryProfile: profile });
} catch (error) {
if (error instanceof WriteFileExistsError) {
console.log();
Expand Down
2 changes: 2 additions & 0 deletions packages/cli/src/pull/pull.ts
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,8 @@ export async function pull({ rootDir, client, worldAddress, replace }: PullOptio
const source = abiToInterface({ name: interfaceName, abi: worldAbi });
await writeFile(path.join(rootDir, interfaceFile), await formatSolidity(source), { overwrite: replaceFiles });
}

return { config };
}

export async function exists(filename: string) {
Expand Down

0 comments on commit 48ca428

Please sign in to comment.