Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

コマンド表示される #29

Merged
merged 1 commit into from
Feb 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions internal/api/receive_file.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import (

type Response struct {
Port string `json:"port"`
ID string `json:"id"`
}

func GetServerInfo(id string) (string,error) {
Expand Down
17 changes: 9 additions & 8 deletions internal/api/send_file.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package api

import (
"bytes"
"encoding/json"
"fmt"
"io"
"mime/multipart"
Expand All @@ -12,7 +13,7 @@ import (
)

// type Response struct {
// pullID string `json:"id"`
// PullID string `json:"id"` // pullIDからPullIDへ変更して公開
// }

// TODO: 取り敢えず書いてみただけなので、動作確認しつつ適宜変更してください。
Expand Down Expand Up @@ -61,12 +62,12 @@ func SendTarToServer(publishList []string, envList []string) error {
}

fmt.Println(string(responseBody.String()))
// var resp Response
// err = json.Unmarshal(responseBody.Bytes(), &resp)
// if err != nil {
// return err
// }
// fmt.Printf("Share this command!!!!\n")
// fmt.Printf("ketos pull -i %s\n", resp.pullID)
var resp Response
err = json.Unmarshal(responseBody.Bytes(), &resp)
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へ変更
return nil
}
Loading