Struct ::command::Commands

The changes to apply to the system.

This is what will be compared to the installed system

Methods

fn ignore_path(self, ignore: String) -> Result

Ignore a path, preventing it from being scanned for differences

fn add_pkg(self, package_manager: String, identifier: String) -> Result

Install a package with the given package manager.

If the package manager isn't enabled, this will be a no-op.

fn remove_pkg(self, package_manager: String, identifier: String) -> Result

Remove a package with the given package manager.

If the package manager isn't enabled, this will be a no-op.

fn rm(self, path: String) -> Result

Remove a path

Check if a file exists in the files/ subdirectory to the configuration

fn copy(self, path: String) -> Result

Create a file with the given contents

fn copy_from(self, path: String, src: String) -> Result

Create a file with the given contents (renaming the file in the process)

The rename is useful to copy a file to a different location (e.g. etc/fstab.hostname to etc/fstab)

fn ln(self, path: String, target: String) -> Result

Create a symlink

fn write(self, path: String, contents: Bytes) -> Result

Create a file with the given contents

fn mkdir(self, path: String) -> Result

Create a directory

fn chown(self, path: String, owner: String) -> Result

Change file owner

fn chgrp(self, path: String, group: String) -> Result

Change file group

fn chmod(self, path: String, mode) -> Result

Change file mode

fn perms(self, path: String, owner: String, group: String, mode) -> Result

Set all permissions at once