Skip to content

Commit 497f916

Browse files
committed
update README.md & fix bug
2 parents 264b894 + 7da7a22 commit 497f916

2 files changed

Lines changed: 17 additions & 6 deletions

File tree

README.md

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
The UCloud Command Line Interface is a tool to manage your UCloud services. It's built on the [UCloud API](https://docs.ucloud.cn/api/summary/index).
44

5-
65
### Install UCloud CLI
76

87
You can install UCloud CLI by downloading executable binary file or building from the source code by yourself.
@@ -13,11 +12,17 @@ Archive links:
1312
[Linux](http://ucloud-sdk.ufile.ucloud.com.cn/ucloud-cli-linux-0.1.1-amd64.tgz)
1413
[Windows](http://ucloud-sdk.ufile.ucloud.com.cn/ucloud-cli-windows-0.1.1-amd64.zip)
1514

16-
Download the binary file and extract to /usr/local/bin directory or add it to the $PATH
15+
SHA-256 hashcode
16+
```
17+
165f1ce4d413bf92e2794efe2722678eb80990602b81fd6e501d0c5f6bbf30bb ucloud-cli-linux-0.1.1-amd64.tgz
18+
e174c2ef268f4b653062d0e1331bf642134a0fafbb745b407969a194d7c1bc0c ucloud-cli-macosx-0.1.1-amd64.tgz
19+
75ff8741d9348881b3d992701590bc27f9278f207a3fb9a12ef0edfab19058d2 ucloud-cli-windows-0.1.1-amd64.zip
20+
```
21+
22+
Download the binary file and extract to /usr/local/bin directory or add it to the $PATH. Take macOS as an example.
1723
```
18-
$ curl -o ucloud-cli.tgz http://ucloud-sdk.ufile.ucloud.com.cn/ucloud-cli-<yourOS>-0.1.1-amd64.tgz
19-
$ tar -zxf ucloud-cli.tgz -C /usr/local/bin
20-
or
24+
$ curl -o ucloud-cli.tgz http://ucloud-sdk.ufile.ucloud.com.cn/ucloud-cli-macosx-0.1.1-amd64.tgz
25+
$ echo "e174c2ef268f4b653062d0e1331bf642134a0fafbb745b407969a194d7c1bc0c *ucloud-cli-macosx-0.1.1-amd64.tgz" | shasum -a 256 -c
2126
$ tar -zxf ucloud-cli.tgz
2227
$ cp ucloud /usr/local/bin
2328
```
@@ -35,6 +40,8 @@ $ make install
3540

3641
### Config UCloud CLI
3742

38-
After install the cli, run 'ucloud config' to complete the cli configuration following the tips.
43+
After install the cli, run 'ucloud config' to complete the cli configuration following the tips. Local settings will be saved in directory $HOME/.ucloud
3944

45+
### Uninstall UCloud CLI
4046

47+
Remove the executable file /user/local/bin/ucloud and the directory $HOME/.ucloud

cmd/list.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ import (
2020
"io/ioutil"
2121

2222
"github.com/spf13/cobra"
23+
"github.com/ucloud/ucloud-cli/model"
2324
"github.com/ucloud/ucloud-cli/util"
2425
"github.com/ucloud/ucloud-sdk-go/service/uaccount"
2526
"github.com/ucloud/ucloud-sdk-go/service/uaccount/types"
@@ -101,6 +102,9 @@ func getUserInfo() (*types.UserInfo, error) {
101102
}
102103
if len(resp.DataSet) == 1 {
103104
userInfo = resp.DataSet[0]
105+
model.ClientConfig.TracerData["userName"] = userInfo.UserEmail
106+
model.ClientConfig.TracerData["userID"] = userInfo.UserEmail
107+
model.ClientConfig.TracerData["companyName"] = userInfo.CompanyName
104108
bytes, err := json.Marshal(userInfo)
105109
if err != nil {
106110
return nil, err

0 commit comments

Comments
 (0)