Skip to content

Commit

Permalink
Add missing main.go
Browse files Browse the repository at this point in the history
  • Loading branch information
mumoshu committed Aug 9, 2020
1 parent c6799d5 commit 441c65d
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
package variant

func RunMain(env Env, opts ...Option) error {
cmd, path, args := GetPathAndArgsFromEnv(env)

m, err := Load(FromPath(path, func(m *Main) {
m.Command = cmd

for _, o := range opts {
o(m)
}
}))
if err != nil {
panic(err)
}

return m.Run(args, RunOptions{DisableLocking: false})
}

0 comments on commit 441c65d

Please sign in to comment.