Skip to content

Commit

Permalink
Add tools example from README
Browse files Browse the repository at this point in the history
  • Loading branch information
ngrash committed Apr 5, 2021
1 parent 830e054 commit 71cb986
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions examples/tools/main.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
package main

import (
"github.com/ftlops/ftl"
"github.com/ftlops/ftl/ops"
)

func main() {
ftl.Step("install tools", func() ftl.State {
missing := ops.MissingPackages("gnupg", "tree", "htop")
if len(missing) == 0 {
return ftl.StateUnchanged
}
ops.UpdateRepos()
ops.Install(missing...)
return ftl.StateChanged
})
}

0 comments on commit 71cb986

Please sign in to comment.