update

package
v0.0.0-...-1bad096 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 13, 2020 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (

	// Cmd updates the application
	Cmd = &cobra.Command{
		Use:   "update",
		Short: "Update application",
		RunE: func(cmd *cobra.Command, args []string) error {
			if isLatest(info.Version) {
				fmt.Println("Already using latest version")
			} else {
				executablePath, _ := filepath.Abs(os.Args[0])
				artifactDownloadURL := fmt.Sprintf("%s/%s/nas-cli-%s-%s%s", glProjectURL, glArtifactURL, runtime.GOOS, runtime.GOARCH, glArtifactQuery)
				fmt.Println("Downloading latest version...")
				err := util.DownloadFile(executablePath, artifactDownloadURL)
				if err == nil {
					os.Chmod(executablePath, 0755)
					console.Success("Update successful")
				}
				return err
			}
			return nil
		},
	}
)

Functions

This section is empty.

Types

type GitLabTag

type GitLabTag struct {
	Message   string `json:"message"`
	Name      string `json:"name"`
	Protected bool   `json:"protected"`
	Target    string `json:"target"`
}

GitLabTag describes tag resource (https://docs.gitlab.com/ee/api/tags.html)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL