lux_lib/lua_rockspec/
deploy.rs1use std::convert::Infallible;
2
3use serde::Deserialize;
4
5use super::{PartialOverride, PerPlatform, PlatformOverridable};
6
7#[derive(Clone, Debug, PartialEq, Deserialize)]
11pub struct DeploySpec {
12 #[serde(default = "default_wrap_bin_scripts")]
17 pub wrap_bin_scripts: bool,
18}
19
20impl Default for DeploySpec {
21 fn default() -> Self {
22 Self {
23 wrap_bin_scripts: true,
24 }
25 }
26}
27
28impl PartialOverride for DeploySpec {
29 type Err = Infallible;
30
31 fn apply_overrides(&self, override_spec: &Self) -> Result<Self, Self::Err> {
32 Ok(Self {
33 wrap_bin_scripts: override_spec.wrap_bin_scripts,
34 })
35 }
36}
37
38impl PlatformOverridable for DeploySpec {
39 type Err = Infallible;
40
41 fn on_nil<T>() -> Result<PerPlatform<T>, <Self as PlatformOverridable>::Err>
42 where
43 T: PlatformOverridable,
44 T: Default,
45 {
46 Ok(PerPlatform::default())
47 }
48}
49
50fn default_wrap_bin_scripts() -> bool {
51 true
52}