mage/release/fs.go

25 lines
397 B
Go
Raw Normal View History

2019-08-02 16:21:29 +02:00
package release
import (
"fmt"
"github.com/magefile/mage/mg"
"github.com/otiai10/copy"
)
func Copy(src, dst string) error {
if mg.Verbose() {
fmt.Printf("Copying file from '%s' to '%s'\n", src, dst)
}
return copy.Copy(dst, src)
}
func MultiCopy(files map[string]string) error {
for dst, src := range files {
if err := Copy(src, dst); err != nil {
return err
}
}
return nil
}