pub struct Package {Show 14 fields
pub name: String,
pub src: String,
pub dest: String,
pub dependencies: Option<Vec<String>>,
pub variables: Table,
pub pre_actions: Vec<String>,
pub post_actions: Vec<String>,
pub targets: HashMap<String, String>,
pub skip: bool,
pub prompts: HashMap<String, String>,
pub ignore: Vec<String>,
pub symlink: Option<bool>,
pub unfold_symlink: bool,
pub clean: bool,
}Fields§
§name: String§src: String§dest: String§dependencies: Option<Vec<String>>§variables: Table§pre_actions: Vec<String>§post_actions: Vec<String>§targets: HashMap<String, String>§skip: bool§prompts: HashMap<String, String>§ignore: Vec<String>§symlink: Option<bool>§unfold_symlink: bool§clean: boolImplementations§
Source§impl Package
impl Package
pub fn new(name: &str, src: &str, dest: &str) -> Self
pub fn from_path(args: &ImportArgs, cwd: &Path) -> Result<Self, Error>
pub fn from_table(pkg_name: &str, pkg_val: &Table) -> Result<Self, Error>
pub fn execute_action( &self, action: &str, variables: &Table, working_dir: &Path, dry_run: bool, ) -> Result<()>
pub fn execute_pre_actions(&self, ctx: &Context, dry_run: bool) -> Result<()>
pub fn execute_post_actions(&self, ctx: &Context, dry_run: bool) -> Result<()>
pub fn get_context_variables(&self, ctx: &Context) -> Table
pub fn should_ignore(&self, rel_path: &Path) -> bool
Sourcepub fn should_unfold(&self) -> bool
pub fn should_unfold(&self) -> bool
Whether a directory package should be deployed as individual per-file
symlinks (leaving the destination a real directory) rather than a
single symlink for the whole directory. Non-empty ignore implies
this, since an ignored path has nowhere real to live under a single
whole-directory symlink.
Sourcepub fn effective_symlink(&self, ctx: &Context) -> bool
pub fn effective_symlink(&self, ctx: &Context) -> bool
Whether this package should be deployed as a symlink. An explicit
per-package symlink setting always wins - Some(true) forces it on
and Some(false) opts out - regardless of the global config flag;
only when the package leaves it unset does the global flag apply.
pub fn resolve_deployment_path(&self, ctx: &Context) -> Result<PathBuf>
Sourcepub fn backup(
&self,
ctx: &Context,
args: &UpdateArgs,
) -> Result<BackupDeployResult>
pub fn backup( &self, ctx: &Context, args: &UpdateArgs, ) -> Result<BackupDeployResult>
Backup the package by copying files from dest to a backup location, recursively.
pub fn should_clean(&self, arg_val: Option<bool>) -> bool
Sourcepub fn resolve_dest(&self, ctx: &Context) -> Result<PathBuf>
pub fn resolve_dest(&self, ctx: &Context) -> Result<PathBuf>
Resolves this package’s effective deployment path for the active
profile: an entry in targets keyed by the profile’s own name wins
(most specific), then one keyed by the profile’s platform (shared
across every profile with that platform), then the package’s dest.
pub fn diff_file( &self, src: &PathBuf, dest: &PathBuf, ctx: &Context, ) -> Result<(), Error>
pub fn diff(&self, ctx: &Context) -> Result<(), Error>
pub fn deploy_file( &self, src: &PathBuf, dest: &PathBuf, ctx: &Context, backup: bool, dry_run: bool, ) -> Result<BackupDeployResult, Error>
Sourcepub fn deploy(
&self,
ctx: &Context,
args: &DeployArgs,
) -> Result<BackupDeployResult, Error>
pub fn deploy( &self, ctx: &Context, args: &DeployArgs, ) -> Result<BackupDeployResult, Error>
Deploy the package by copying files from src to dest.