Skip to content

Commit

Permalink
Merge pull request #29 from Doer-org/feature/display_command
Browse files Browse the repository at this point in the history
コマンド表示される
  • Loading branch information
clcl777 authored Feb 11, 2024
2 parents ce445ea + 0dfdd05 commit 3c3fad0
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
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
}

0 comments on commit 3c3fad0

Please sign in to comment.