From 8168bb512435db3103bb740d5fa0314cb65f1a61 Mon Sep 17 00:00:00 2001 From: daimond113 <72147841+daimond113@users.noreply.github.com> Date: Tue, 27 Aug 2024 19:07:11 +0200 Subject: [PATCH] fix: handle disabled features --- src/cli/commands/install.rs | 1 + src/cli/commands/mod.rs | 3 +++ src/scripts.rs | 3 +++ 3 files changed, 7 insertions(+) diff --git a/src/cli/commands/install.rs b/src/cli/commands/install.rs index 6daf0f6..167cc9d 100644 --- a/src/cli/commands/install.rs +++ b/src/cli/commands/install.rs @@ -183,6 +183,7 @@ impl InstallCommand { .link_dependencies(&downloaded_graph) .context("failed to link dependencies")?; + #[cfg(feature = "patches")] project .apply_patches(&downloaded_graph) .context("failed to apply patches")?; diff --git a/src/cli/commands/mod.rs b/src/cli/commands/mod.rs index fa81bb7..44481bd 100644 --- a/src/cli/commands/mod.rs +++ b/src/cli/commands/mod.rs @@ -4,6 +4,7 @@ use pesde::Project; mod add; mod auth; mod config; +#[cfg(any(feature = "lune", feature = "luau"))] mod execute; mod init; mod install; @@ -63,6 +64,7 @@ pub enum Subcommand { Outdated(outdated::OutdatedCommand), /// Executes a binary package without needing to be run in a project directory + #[cfg(any(feature = "lune", feature = "luau"))] #[clap(name = "x", visible_alias = "execute", visible_alias = "exec")] Execute(execute::ExecuteCommand), } @@ -93,6 +95,7 @@ impl Subcommand { update.run(project, multi, reqwest) } Subcommand::Outdated(outdated) => outdated.run(project), + #[cfg(any(feature = "lune", feature = "luau"))] Subcommand::Execute(execute) => execute.run(project, reqwest), } } diff --git a/src/scripts.rs b/src/scripts.rs index 8e80c47..4c311e0 100644 --- a/src/scripts.rs +++ b/src/scripts.rs @@ -21,12 +21,15 @@ pub enum ScriptName { impl Display for ScriptName { fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result { + #[cfg(feature = "roblox")] match self { #[cfg(feature = "roblox")] ScriptName::RobloxSyncConfigGenerator => write!(f, "roblox_sync_config_generator"), #[cfg(feature = "wally-compat")] ScriptName::SourcemapGenerator => write!(f, "sourcemap_generator"), } + #[cfg(not(feature = "roblox"))] + Ok(()) } }