Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsVerbose ¶ added in v0.14.3
IsVerbose checks if the "verbose" flag is set for the given Cobra command. It first checks if the verbose flag is explicitly set on the command. If not, it falls back to the config value using viper.
Parameters:
- cmd: A pointer to a Cobra command from which the "verbose" flag is retrieved.
Returns:
- bool: True if the "verbose" flag is set to true, otherwise false.
func StartChildProcess ¶
StartChildProcess starts a child process with the given exec.Cmd configuration. It sets up the standard input, output, and error streams to be the same as the parent process. Additionally, it captures interrupt signals (ctl + c) and forwards them to the child process.
Parameters:
- c: A pointer to an exec.Cmd struct representing the command to be executed.
The function starts the command and waits for it to finish. If the command exits with an error, it logs the error and exits gracefully. If the command completes successfully, it logs a success message and exits with a status code of 0.
func SyncDirectory ¶
SyncDirectory synchronizes the contents of the source directory (srcDir) with the destination directory (destDir). It copies files and recursively syncs subdirectories. If isVerbose is true, it logs the files being copied.
Parameters:
- srcDir: The source directory to sync from.
- destDir: The destination directory to sync to.
- isVerbose: A boolean flag to enable verbose logging.
Returns:
- error: An error if any occurs during the synchronization process., otherwise nil.
Types ¶
This section is empty.
Directories
¶
| Path | Synopsis |
|---|---|
|
Package config is a helper package to facilitate getting and setting config values using Viper.
|
Package config is a helper package to facilitate getting and setting config values using Viper. |
|
Package log is a wrapper around colorizing the log output.
|
Package log is a wrapper around colorizing the log output. |