summaryrefslogtreecommitdiff
path: root/src/dev.rs
diff options
context:
space:
mode:
authormo8it <mo8it@proton.me>2024-04-18 11:28:28 +0200
committermo8it <mo8it@proton.me>2024-04-18 11:28:28 +0200
commit1eac00e89ae9e0ed6969f5036e9c8c43e4435e86 (patch)
tree833bd7b226d64ad8d52b641a276e7e9a304f9d9c /src/dev.rs
parent2e9b9a9f130c89e9b2856f17c24cdab841929b28 (diff)
Disable init command during development
Diffstat (limited to 'src/dev.rs')
-rw-r--r--src/dev.rs12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/dev.rs b/src/dev.rs
index feca99e..1430f11 100644
--- a/src/dev.rs
+++ b/src/dev.rs
@@ -1,6 +1,8 @@
-use anyhow::{Context, Result};
+use anyhow::{bail, Context, Result};
use clap::Subcommand;
+use crate::DEVELOPING_OFFICIAL_RUSTLINGS;
+
mod check;
mod init;
mod update;
@@ -15,7 +17,13 @@ pub enum DevCommands {
impl DevCommands {
pub fn run(self) -> Result<()> {
match self {
- DevCommands::Init => init::init().context(INIT_ERR),
+ DevCommands::Init => {
+ if DEVELOPING_OFFICIAL_RUSTLINGS {
+ bail!("Disabled while developing the official Rustlings");
+ }
+
+ init::init().context(INIT_ERR)
+ }
DevCommands::Check => check::check(),
DevCommands::Update => update::update(),
}