From 9a64a12f8e51868e87060ef02baa2994fd34b885 Mon Sep 17 00:00:00 2001 From: daimond113 <72147841+daimond113@users.noreply.github.com> Date: Mon, 7 Oct 2024 16:42:49 +0200 Subject: [PATCH] fix: add feature gates to init command --- CHANGELOG.md | 4 ++++ src/cli/commands/init.rs | 12 ++++++++---- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ab5905c..fc64736 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,10 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [Unreleased] - 2024-10-07 +### Fixed +- Add feature gates to `wally-compat` specific code in init command by @daimond113 + ## [0.5.0-rc.3] - 2024-10-06 ### Fixed - Use workspace specifiers' `target` field when resolving by @daimond113 diff --git a/src/cli/commands/init.rs b/src/cli/commands/init.rs index 012963a..d0eff20 100644 --- a/src/cli/commands/init.rs +++ b/src/cli/commands/init.rs @@ -136,6 +136,7 @@ impl InitCommand { ) .context("failed to write sync config generator script file")?; + #[cfg(feature = "wally-compat")] std::fs::write( folder.join(format!("{}.luau", ScriptName::SourcemapGenerator)), script_contents(Path::new(&format!( @@ -154,10 +155,13 @@ impl InitCommand { ScriptName::RobloxSyncConfigGenerator )); - scripts[&ScriptName::SourcemapGenerator.to_string()] = toml_edit::value(format!( - concat!(".", env!("CARGO_PKG_NAME"), "/{}.luau"), - ScriptName::SourcemapGenerator - )); + #[cfg(feature = "wally-compat")] + { + scripts[&ScriptName::SourcemapGenerator.to_string()] = toml_edit::value(format!( + concat!(".", env!("CARGO_PKG_NAME"), "/{}.luau"), + ScriptName::SourcemapGenerator + )); + } } manifest["indices"].or_insert(toml_edit::Item::Table(toml_edit::Table::new()))