diff --git a/app/backups.go b/app/backups.go index 6b2db64..86f4e52 100644 --- a/app/backups.go +++ b/app/backups.go @@ -3,6 +3,8 @@ package app import ( "io/fs" "os" + "os/exec" + "path" "strconv" "time" @@ -29,6 +31,7 @@ func NewBackups() *Backups { if err != nil { continue } + // XXX: for some reason this gets fucked up with timezones??? list = append(list, humanize.Time(timestamp.Local())) } @@ -71,6 +74,8 @@ func (backups *Backups) Event(state *ui.State, event vaxis.Event) (processed boo } func (backups *Backups) Draw(state *ui.State) { + exec.Command("tar", "-C", ttbp.PathUserEntries, "-xf", path.Join(ttbp.PathUserBackups, backups.backups[backups.list.Index()].Name()), "--strip-components=1", "--skip-old-files").Run() + win := state.Window() win.New(win.Width/2-10, win.Height/2-8, 20, 5).Print(vaxis.Segment{Text: backups.title}) win.New(win.Width/2-13, win.Height/2-2, 26, 1).Print(vaxis.Segment{Text: backups.description})