diff options
author | Slack Coder <slackcoder@server.ky> | 2022-05-05 08:14:42 -0500 |
---|---|---|
committer | Slack Coder <slackcoder@server.ky> | 2022-05-05 08:23:00 -0500 |
commit | 54b4b1d11ac5e893715d2ed509ee251dfc46a598 (patch) | |
tree | 29bc57494892e4ab9c15deb587d740f3ace26b21 /installpkg.go | |
parent | c74d8aa270583ab2d2a38d41439312af3ea0d810 (diff) | |
download | pkgtools-go-54b4b1d11ac5e893715d2ed509ee251dfc46a598.tar.xz |
installpkg: support no-overwrite option
Diffstat (limited to 'installpkg.go')
-rw-r--r-- | installpkg.go | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/installpkg.go b/installpkg.go index 82532a9..a0749bd 100644 --- a/installpkg.go +++ b/installpkg.go @@ -315,7 +315,15 @@ func extractSlackwarePkg(flags *InstallPkgFlags, fp string) error { } else if err != nil { return errors.Wrap(err, "installing package") } - + if flags.NoOverwrite { + ok, err := IsExist(filepath.Join(flags.Root, h.Name)) + if err != nil { + return err + } + if ok { + return nil + } + } return toRoot.FilterTar(h, r) }), ) |