-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Alex Ellis (OpenFaaS Ltd) <[email protected]>
- Loading branch information
Showing
8 changed files
with
81 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
/actuated-cli | ||
/bin |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
// Copyright (c) arkade author(s) 2022. All rights reserved. | ||
// Licensed under the MIT license. See LICENSE file in the project root for full license information. | ||
|
||
package cmd | ||
|
||
import ( | ||
"fmt" | ||
|
||
"github.com/morikuni/aec" | ||
"github.com/self-actuated/actuated-cli/pkg" | ||
"github.com/spf13/cobra" | ||
) | ||
|
||
func PrintASCIIArt() { | ||
arkadeLogo := aec.BlueF.Apply(actuatedCLIStr) | ||
fmt.Print(arkadeLogo) | ||
} | ||
|
||
func MakeVersion() *cobra.Command { | ||
var command = &cobra.Command{ | ||
Use: "version", | ||
Short: "Print the version", | ||
Example: ` arkade version`, | ||
Aliases: []string{"v"}, | ||
SilenceUsage: false, | ||
} | ||
command.Run = func(cmd *cobra.Command, args []string) { | ||
PrintASCIIArt() | ||
if len(pkg.Version) == 0 { | ||
fmt.Println("Version: dev") | ||
} else { | ||
fmt.Println("Version:", pkg.Version) | ||
} | ||
fmt.Println("Git Commit:", pkg.GitCommit) | ||
fmt.Println() | ||
|
||
} | ||
return command | ||
} | ||
|
||
const actuatedCLIStr = ` | ||
░█▀█░█▀▀░▀█▀░█░█░█▀█░▀█▀░█▀▀░█▀▄ | ||
░█▀█░█░░░░█░░█░█░█▀█░░█░░█▀▀░█░█ | ||
░▀░▀░▀▀▀░░▀░░▀▀▀░▀░▀░░▀░░▀▀▀░▀▀░ | ||
Command Line Interface (CLI) | ||
Copyright OpenFaaS Ltd 2023. All rights reserved. | ||
` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
package pkg | ||
|
||
var ( | ||
Version, | ||
GitCommit string | ||
) |