Skip to content

Commit de13daf

Browse files
Merge pull request #5 from DarthBenro008/stage-0.1.4
feat: default command run instead of subcommand
2 parents 090e323 + 3cea7e9 commit de13daf

File tree

4 files changed

+48
-11
lines changed

4 files changed

+48
-11
lines changed

.github/workflows/Releaser.yaml

+23-1
Original file line numberDiff line numberDiff line change
@@ -66,4 +66,26 @@ jobs:
6666
with:
6767
body_path: CHANGELOG.md
6868
env:
69-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
69+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
70+
homebrew:
71+
needs: changelog
72+
name: Bump Homebrew formula
73+
runs-on: ubuntu-latest
74+
steps:
75+
- name: Extract version
76+
id: extract-version
77+
run: |
78+
printf "::set-output name=%s::%s\n" tag-name "${GITHUB_REF#refs/tags/}"
79+
- uses: mislav/bump-homebrew-formula-action@v1
80+
if: "!contains(github.ref, '-')" # skip prereleases
81+
with:
82+
formula-name: gunfollower
83+
homebrew-tap: DarthBenro008/homebrew-gunfollower
84+
base-branch: master
85+
download-url: https://github.com/DarthBenro008/gunfollower/releases/latest/download/gunfollower-macos.tar.gz
86+
commit-message: |
87+
{{formulaName}} {{version}}
88+
89+
bump: Update gunfollower version
90+
env:
91+
COMMITTER_TOKEN: ${{ secrets.COMMITTER_TOKEN }}

CHANGELOG.md

+9
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,15 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## [Releases]
99

10+
## [0.1.4] - 2022-01-06
11+
12+
### Enable Gunfollower default command and enhanced CI
13+
14+
#### Features
15+
16+
- Now you can simply run `gunfollower` instead of `gunfollower check`
17+
- Automatic CI to bump and update Homebrew releases
18+
1019
## [0.1.3] - 2021-12-08
1120

1221
### Nullable Fields fix of various user data

src/cli.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ use structopt::StructOpt;
1414
)]
1515
pub struct CommandLineArgs {
1616
#[structopt(subcommand)]
17-
pub cmd: Commands,
17+
pub cmd: Option<Commands>,
1818
}
1919

2020
#[derive(Debug, StructOpt, PartialEq)]

src/main.rs

+15-9
Original file line numberDiff line numberDiff line change
@@ -17,17 +17,23 @@ fn main() {
1717
let followers_db = FollowersDatabase::new();
1818
let api = ApiClient::new();
1919
match cmd {
20-
Commands::Check => match check_handler(&followers_db, &api) {
21-
Ok(_) => {}
22-
Err(err) => print_error("Failed to check who unfollowed you", &err),
20+
Some(cmd) => match cmd {
21+
Commands::Check => match check_handler(&followers_db, &api) {
22+
Ok(_) => {}
23+
Err(err) => print_error("Failed to check who unfollowed you", &err),
24+
},
25+
Commands::Clear => match clear_handler(&followers_db) {
26+
Ok(_) => {}
27+
Err(err) => print_error("Failed to clear database", &err),
28+
},
29+
Commands::Status => match status_handler(&followers_db, &api) {
30+
Ok(_) => {}
31+
Err(err) => print_error("Failed to fetch status", &err),
32+
},
2333
},
24-
Commands::Clear => match clear_handler(&followers_db) {
34+
_ => match check_handler(&followers_db, &api) {
2535
Ok(_) => {}
26-
Err(err) => print_error("Failed to clear database", &err),
27-
},
28-
Commands::Status => match status_handler(&followers_db, &api) {
29-
Ok(_) => {}
30-
Err(err) => print_error("Failed to fetch status", &err),
36+
Err(err) => print_error("Failed to check who unfollowed you", &err),
3137
},
3238
}
3339
}

0 commit comments

Comments
 (0)