dirSync

package module
v0.0.6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 28, 2023 License: MIT Imports: 2 Imported by: 0

README

dirSync

a very small go package for syncing directories with an option to make symlinks instead of copying

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

func DirSync(syncFrom string, syncTo string, copy bool) error

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL