Documentation
¶
Overview ¶
A very small package that syncs the contents of a directory to another with the option to create symlinks instead of copying
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DirSync ¶
DirSync synchronizes the contents of the syncFrom directory to the syncTo directory.
!!!!! WARNING !!!!!! currently the symlink functionality is broken, please refrain from using it
It takes two parameters: syncFrom, which is the source directory to sync from, and syncTo, which is the target directory to sync to. Both syncFrom and syncTo can contain env variables, wich are going to be expanded during runtime.
The function has an optional parameter named copy, which indicates whether to perform a copy or create a symlink. If copy is set to true, the function will copy the files from syncFrom to syncTo. If copy is set to false, the function will create symbolic links from syncFrom to syncTo.
The function returns an error if there is any error during the synchronization process aswell as if the syncFrom directory does not exist. If the synchronization is successful, it returns nil.
Types ¶
This section is empty.