Skip to content
This repository was archived by the owner on Dec 15, 2023. It is now read-only.

Commit a6fde21

Browse files
committed
fix: history and print format
1 parent f90a911 commit a6fde21

File tree

5 files changed

+42
-12
lines changed

5 files changed

+42
-12
lines changed

.github/workflows/github_release.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: github-release
2+
3+
on:
4+
release:
5+
types: [ created ]
6+
7+
jobs:
8+
github-release:
9+
name: Release for ${{ matrix.os }}
10+
runs-on: ${{ matrix.os }}
11+
strategy:
12+
matrix:
13+
include:
14+
- os: ubuntu-latest
15+
artifact_name: iotdb
16+
asset_name: iotdb-linux
17+
- os: windows-latest
18+
artifact_name: iotdb.exe
19+
asset_name: iotdb.exe
20+
- os: macos-latest
21+
artifact_name: iotdb
22+
asset_name: iotdb-mac
23+
steps:
24+
- uses: actions/checkout@v2
25+
- name: Build
26+
run: cargo build --release
27+
- name: Upload binaries to release
28+
uses: svenstaro/upload-release-action@v2
29+
with:
30+
repo_token: ${{secrets.DEPLOY_KEY}}
31+
file: target/release/${{ matrix.artifact_name }}
32+
asset_name: ${{ matrix.asset_name }}
33+
tag: ${{ github.ref }}

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,4 @@ path = "src/main.rs"
1818
dirs = "4.0.0"
1919
structopt = "0.3"
2020
rustyline = "9.0.0"
21-
iotdb = { git = "https://github.com/francis-du/iotdb-rs.git", rev = "5c9b010" }
21+
iotdb = { git = "https://github.com/francis-du/iotdb-rs.git", rev = "8551bd5" }

README.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -71,9 +71,8 @@ iotdb -u root -p root --endpoint 127.0.0.1:6667 -t UTC+8
7171
$ iotdb "SHOW STORAGE GROUP"
7272
+---------------+
7373
| storage group |
74-
+===============+
75-
| root.ln |
7674
+---------------+
75+
| root.ln |
7776
| root.sg1 |
7877
+---------------+
7978
```
@@ -90,9 +89,8 @@ $ iotdb -u root -p root --endpoint 127.0.0.1:6667 -t UTC+8
9089
IOTDB#(127.0.0.1:6667)> SHOW STORAGE GROUP
9190
+---------------+
9291
| storage group |
93-
+===============+
94-
| root.ln |
9592
+---------------+
93+
| root.ln |
9694
| root.sg1 |
9795
+---------------+
9896
```

docs/src/get-started.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -71,9 +71,8 @@ iotdb -u root -p root --endpoint 127.0.0.1:6667 -t UTC+8
7171
$ iotdb "SHOW STORAGE GROUP"
7272
+---------------+
7373
| storage group |
74-
+===============+
75-
| root.ln |
7674
+---------------+
75+
| root.ln |
7776
| root.sg1 |
7877
+---------------+
7978
```
@@ -90,9 +89,8 @@ $ iotdb -u root -p root --endpoint 127.0.0.1:6667 -t UTC+8
9089
IOTDB#(127.0.0.1:6667)> SHOW STORAGE GROUP
9190
+---------------+
9291
| storage group |
93-
+===============+
94-
| root.ln |
9592
+---------------+
93+
| root.ln |
9694
| root.sg1 |
9795
+---------------+
9896
```

src/main.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -128,13 +128,14 @@ fn open_session(config: Config) -> Session {
128128

129129
fn readline(mut session: Session, prompt: String) {
130130
println!("{}", ASCII_NAME);
131-
132131
let his_file: PathBuf = dirs::home_dir()
133132
.unwrap_or(PathBuf::from("/home"))
134-
.join("iotdb.his");
133+
.join(".iotdb_his");
135134

136135
let mut rl = Editor::<()>::new();
137-
rl.load_history(his_file.as_path()).unwrap();
136+
if his_file.as_path().exists() {
137+
rl.load_history(his_file.as_path()).unwrap();
138+
}
138139
loop {
139140
let readline = rl.readline(prompt.as_str());
140141
match readline {

0 commit comments

Comments
 (0)