mirror of
https://github.com/alexellis/arkade.git
synced 2022-05-07 18:22:49 +03:00
The get command downloads tools from GitHub release pages and from custom URLs using a go template to define the URL and filename according to OS and architecture. Tested with unit tests and with the two initial apps: faas-cli and kubectl. Signed-off-by: Alex Ellis (OpenFaaS Ltd) <alexellis2@gmail.com>
39 lines
789 B
Go
39 lines
789 B
Go
// Copyright (c) arkade author(s) 2020. All rights reserved.
|
|
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
|
|
|
package main
|
|
|
|
import (
|
|
"os"
|
|
|
|
"github.com/alexellis/arkade/cmd"
|
|
"github.com/spf13/cobra"
|
|
)
|
|
|
|
func main() {
|
|
|
|
cmdVersion := cmd.MakeVersion()
|
|
cmdInstall := cmd.MakeInstall()
|
|
cmdInfo := cmd.MakeInfo()
|
|
|
|
printarkadeASCIIArt := cmd.PrintArkadeASCIIArt
|
|
|
|
var rootCmd = &cobra.Command{
|
|
Use: "arkade",
|
|
Run: func(cmd *cobra.Command, args []string) {
|
|
printarkadeASCIIArt()
|
|
cmd.Help()
|
|
},
|
|
}
|
|
|
|
rootCmd.AddCommand(cmdInstall)
|
|
rootCmd.AddCommand(cmdVersion)
|
|
rootCmd.AddCommand(cmdInfo)
|
|
rootCmd.AddCommand(cmd.MakeUpdate())
|
|
rootCmd.AddCommand(cmd.MakeGet())
|
|
|
|
if err := rootCmd.Execute(); err != nil {
|
|
os.Exit(1)
|
|
}
|
|
}
|