Skip to content

Commit 085f281

Browse files
authored
node: remove create flag from graphman deploy
1 parent 03d2d4d commit 085f281

File tree

2 files changed

+6
-15
lines changed

2 files changed

+6
-15
lines changed

node/src/bin/manager.rs

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -317,10 +317,6 @@ pub enum Command {
317317
/// The url of the graph-node
318318
#[clap(long, short, default_value = "http://localhost:8020")]
319319
url: String,
320-
321-
/// Create the subgraph name if it does not exist
322-
#[clap(long, short)]
323-
create: bool,
324320
},
325321
}
326322

@@ -1681,12 +1677,11 @@ async fn main() -> anyhow::Result<()> {
16811677
deployment,
16821678
name,
16831679
url,
1684-
create,
16851680
} => {
16861681
let store = ctx.store();
16871682
let subgraph_store = store.subgraph_store();
16881683

1689-
commands::deploy::run(subgraph_store, deployment, name, url, create).await
1684+
commands::deploy::run(subgraph_store, deployment, name, url).await
16901685
}
16911686
}
16921687
}

node/src/manager/commands/deploy.rs

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,6 @@ pub async fn run(
6868
deployment: DeploymentSearch,
6969
search: DeploymentSearch,
7070
url: String,
71-
create: bool,
7271
) -> Result<()> {
7372
let hash = match deployment {
7473
DeploymentSearch::Hash { hash, shard: _ } => hash,
@@ -80,16 +79,13 @@ pub async fn run(
8079
_ => bail!("The `name` must be a valid subgraph name"),
8180
};
8281

83-
if create {
84-
println!("Creating subgraph `{}`", name);
85-
let subgraph_name =
86-
SubgraphName::new(name.clone()).map_err(|_| anyhow!("Invalid subgraph name"))?;
82+
let subgraph_name =
83+
SubgraphName::new(name.clone()).map_err(|_| anyhow!("Invalid subgraph name"))?;
8784

88-
let exists = subgraph_store.subgraph_exists(&subgraph_name)?;
85+
let exists = subgraph_store.subgraph_exists(&subgraph_name)?;
8986

90-
if exists {
91-
bail!("Subgraph with name `{}` already exists", name);
92-
}
87+
if !exists {
88+
println!("Creating subgraph `{}`", name);
9389

9490
// Send the subgraph_create request
9591
send_create_request(&name, &url).await?;

0 commit comments

Comments
 (0)