Skip to content

Commit

Permalink
Merge pull request #30 from Doer-org/fix/output_sentence
Browse files Browse the repository at this point in the history
ketosマーク表示修正
  • Loading branch information
clcl777 authored Feb 11, 2024
2 parents 3c3fad0 + af02dc2 commit b85976e
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 27 deletions.
14 changes: 2 additions & 12 deletions cmd/pull.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@ Copyright © 2024 Do'er
package cmd

import (
"fmt"

"github.com/Doer-org/ketos/internal"
"github.com/Doer-org/ketos/internal/api"
docker "github.com/Doer-org/ketos/internal/docker/pull"
"github.com/spf13/cobra"
Expand All @@ -17,16 +16,6 @@ var pullCmd = &cobra.Command{
Short: "Pull Docker image from the server and run it",
Long: `This command pulls a docker image from the server and runs it.`,
// Args: cobra.ExactArgs(0),
PreRun: func(cmd *cobra.Command, args []string) {
fmt.Println(`
__ __ ________________ _____
/ //_// ____/_ __/ __ \/ ___/
/ ,< / __/ / / / / / /\__ \
/ /| |/ /___ / / / /_/ /___/ /
/_/ |_/_____/ /_/ \____//____/
`)
},
RunE: func(cmd *cobra.Command, args []string) error {
id, err := cmd.Flags().GetString("id")
if err != nil {
Expand All @@ -49,6 +38,7 @@ var pullCmd = &cobra.Command{
if err != nil {
return err
}
internal.PrintKetos()
return nil
},
}
Expand Down
8 changes: 0 additions & 8 deletions cmd/push.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,14 +58,6 @@ var pushCmd = &cobra.Command{
if err != nil {
return err
}
fmt.Println(`
__ __ ________________ _____
/ //_// ____/_ __/ __ \/ ___/
/ ,< / __/ / / / / / /\__ \
/ /| |/ /___ / / / /_/ /___/ /
/_/ |_/_____/ /_/ \____//____/
`)
return nil
},
}
Expand Down
12 changes: 5 additions & 7 deletions internal/api/send_file.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,10 @@ import (
"os"
"path/filepath"
"strings"
)

// type Response struct {
// PullID string `json:"id"` // pullIDからPullIDへ変更して公開
// }
"github.com/Doer-org/ketos/internal"
)

// TODO: 取り敢えず書いてみただけなので、動作確認しつつ適宜変更してください。
func SendTarToServer(publishList []string, envList []string) error {
file, err := os.Open(filePath)
if err != nil {
Expand Down Expand Up @@ -67,7 +64,8 @@ func SendTarToServer(publishList []string, envList []string) error {
if err != nil {
return err
}
fmt.Printf("\n\n\nShare this command!!!!\n")
fmt.Printf("ketos pull -i %s\n", resp.ID) // resp.pullIDからresp.PullIDへ変更
internal.PrintKetos()
fmt.Printf("🐳🐳🐳 Share this command 🐳🐳🐳\n\n")
fmt.Printf("ketos pull -i %s\n", resp.ID)
return nil
}
13 changes: 13 additions & 0 deletions internal/print_ketos.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package internal

import "fmt"

func PrintKetos() {
fmt.Println(`
__ __ ________________ _____
/ //_// ____/_ __/ __ \/ ___/
/ ,< / __/ / / / / / /\__ \
/ /| |/ /___ / / / /_/ /___/ /
/_/ |_/_____/ /_/ \____//____/
`)
}

0 comments on commit b85976e

Please sign in to comment.