From 4f1fb15192a19b5774c66e62ba952280f09d535c Mon Sep 17 00:00:00 2001 From: LEI Date: Thu, 13 Sep 2018 19:08:00 +0200 Subject: [PATCH] udo --- internal/dot/copy.go | 5 ----- internal/dot/hook.go | 19 +++++++------------ 2 files changed, 7 insertions(+), 17 deletions(-) diff --git a/internal/dot/copy.go b/internal/dot/copy.go index 9094663..7c050ce 100644 --- a/internal/dot/copy.go +++ b/internal/dot/copy.go @@ -309,8 +309,3 @@ func newRemoteFile(url string) (*remoteFile, error) { r.Etag = resp.Header.Get("Etag") return r, nil } - -// remoteFileCompare TODO not implemented -// func remoteFileCompare(src, dst string) (bool, error) { -// return true, nil -// } diff --git a/internal/dot/hook.go b/internal/dot/hook.go index 1004cf9..52aedfa 100644 --- a/internal/dot/hook.go +++ b/internal/dot/hook.go @@ -92,7 +92,7 @@ func (t *Hook) Status() error { return nil } -// Do task +// Do task (install, post_install) func (t *Hook) Do() error { if err := t.Status(); err != nil { switch err { @@ -109,7 +109,7 @@ func (t *Hook) Do() error { return cmd.Run() } -// Undo task (non applicable) +// Undo task (remove, post_remove) func (t *Hook) Undo() error { if err := t.Status(); err != nil { switch err { @@ -121,14 +121,9 @@ func (t *Hook) Undo() error { return err } } - // if t.URL != "" && t.Dest != "" { - // // TODO: check remote file? - // return os.Remove(t.Dest) - // } - // cmd, err := t.buildCmd() - // if err != nil { - // return err - // } - // return cmd.Run() - return fmt.Errorf("not implemented") + cmd, err := t.buildCmd() + if err != nil { + return err + } + return cmd.Run() }