archive/AddFile: add missing error check

See: #6
This commit is contained in:
Clayton Craft
2021-09-03 21:35:29 -07:00
parent 4538e7d46b
commit dc586f61fc

View File

@@ -137,6 +137,9 @@ func (archive *Archive) AddFile(file string, dest string) error {
// make sure target is an absolute path
if !filepath.IsAbs(target) {
target, err = misc.RelativeSymlinkTargetToDir(target, filepath.Dir(file))
if err != nil {
return err
}
}
// TODO: add verbose mode, print stuff like this:
// log.Printf("symlink: %q, target: %q", file, target)