Don't serialize emitLegacyScripts if it's None (#835)

This commit is contained in:
Micah
2024-01-16 10:09:16 -08:00
committed by GitHub
parent b12ce47e7e
commit c7173ac832

View File

@@ -8,9 +8,7 @@ use std::{
use serde::{Deserialize, Serialize};
use thiserror::Error;
use crate::{
glob::Glob, resolution::UnresolvedValue, snapshot_middleware::emit_legacy_scripts_default,
};
use crate::{glob::Glob, resolution::UnresolvedValue};
static PROJECT_FILENAME: &str = "default.project.json";
@@ -75,12 +73,10 @@ pub struct Project {
#[serde(skip_serializing_if = "Option::is_none")]
pub serve_address: Option<IpAddr>,
/// Determines if rojo should emit scripts with the appropriate `RunContext` for `*.client.lua` and `*.server.lua` files in the project.
/// Or, if rojo should keep the legacy behavior of emitting LocalScripts and Scripts with legacy Runcontext
#[serde(
default = "emit_legacy_scripts_default",
skip_serializing_if = "Option::is_none"
)]
/// Determines if Rojo should emit scripts with the appropriate `RunContext`
/// for `*.client.lua` and `*.server.lua` files in the project instead of
/// using `Script` and `LocalScript` Instances.
#[serde(skip_serializing_if = "Option::is_none")]
pub emit_legacy_scripts: Option<bool>,
/// A list of globs, relative to the folder the project file is in, that