Skip to content

Commit

Permalink
fix: mantle deployment (#83)
Browse files Browse the repository at this point in the history
  • Loading branch information
leoslr authored Nov 20, 2023
1 parent 95eaa94 commit eab32ca
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions cli/commands/deploy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,18 +24,18 @@ export const builder = (y: yargs.Argv) =>
.option("token", {
desc: "TheGraph token",
type: "string",
demandOption: true,
})
.option("version", {
desc: "The subgraph version label, used by non-hosted service graph nodes",
desc:
"The subgraph version label, used by non-hosted service graph nodes",
type: "string",
demandOption: true,
})
.check(({ all, network }) => {
if (all && network)
throw new Error("Cannot specify both -all and positional `network`");
if (all || network) return true;
throw new Error("One of --all or positional `network` must be specified");
throw new Error("One of --all or positional `network` must be specified");
});

export const handler = ({
Expand All @@ -45,6 +45,11 @@ export const handler = ({
version,
}: Awaited<ReturnType<typeof builder>["argv"]>) => {
const networkList = all ? networks : network || [];
const options = token
? {
"access-token": token,
}
: undefined;
for (const net of networkList) {
console.log(`Deploy on ${net}`);
deploySubgraph(
Expand All @@ -55,9 +60,7 @@ export const handler = ({
node: `${graphNodeInfoByNetwork[net]?.deploy ||
defaultGraphNodeInfo.deploy}`,
},
{
"access-token": token,
},
options,
);
}
};

0 comments on commit eab32ca

Please sign in to comment.