Skip to content

Commit

Permalink
udo
Browse files Browse the repository at this point in the history
  • Loading branch information
LEI committed Sep 13, 2018
1 parent a5a7c1d commit 4f1fb15
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 17 deletions.
5 changes: 0 additions & 5 deletions internal/dot/copy.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
// }
19 changes: 7 additions & 12 deletions internal/dot/hook.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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 {
Expand All @@ -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()
}

0 comments on commit 4f1fb15

Please sign in to comment.