mirror of
https://github.com/safing/portmaster
synced 2025-09-01 18:19:12 +00:00
38 lines
631 B
Go
38 lines
631 B
Go
package main
|
|
|
|
import (
|
|
"os"
|
|
"path/filepath"
|
|
|
|
"github.com/safing/portbase/utils"
|
|
|
|
"github.com/spf13/cobra"
|
|
)
|
|
|
|
var (
|
|
updatesStorage *utils.DirStructure
|
|
)
|
|
|
|
var rootCmd = &cobra.Command{
|
|
Use: "uptool",
|
|
Short: "helper tool for the update process",
|
|
Run: func(cmd *cobra.Command, args []string) {
|
|
cmd.Usage()
|
|
},
|
|
PersistentPreRunE: func(cmd *cobra.Command, args []string) error {
|
|
absPath, err := filepath.Abs(".")
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
updatesStorage = utils.NewDirStructure(absPath, 0755)
|
|
return nil
|
|
},
|
|
SilenceUsage: true,
|
|
}
|
|
|
|
func main() {
|
|
if err := rootCmd.Execute(); err != nil {
|
|
os.Exit(1)
|
|
}
|
|
}
|