Skip to content

Commit

Permalink
Merge pull request #5 from DarthBenro008/stage-0.1.4
Browse files Browse the repository at this point in the history
feat: default command run instead of subcommand
  • Loading branch information
DarthBenro008 authored Jan 6, 2022
2 parents 090e323 + 3cea7e9 commit de13daf
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 11 deletions.
24 changes: 23 additions & 1 deletion .github/workflows/Releaser.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -66,4 +66,26 @@ jobs:
with:
body_path: CHANGELOG.md
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
homebrew:
needs: changelog
name: Bump Homebrew formula
runs-on: ubuntu-latest
steps:
- name: Extract version
id: extract-version
run: |
printf "::set-output name=%s::%s\n" tag-name "${GITHUB_REF#refs/tags/}"
- uses: mislav/bump-homebrew-formula-action@v1
if: "!contains(github.ref, '-')" # skip prereleases
with:
formula-name: gunfollower
homebrew-tap: DarthBenro008/homebrew-gunfollower
base-branch: master
download-url: https://github.com/DarthBenro008/gunfollower/releases/latest/download/gunfollower-macos.tar.gz
commit-message: |
{{formulaName}} {{version}}
bump: Update gunfollower version
env:
COMMITTER_TOKEN: ${{ secrets.COMMITTER_TOKEN }}
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,15 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Releases]

## [0.1.4] - 2022-01-06

### Enable Gunfollower default command and enhanced CI

#### Features

- Now you can simply run `gunfollower` instead of `gunfollower check`
- Automatic CI to bump and update Homebrew releases

## [0.1.3] - 2021-12-08

### Nullable Fields fix of various user data
Expand Down
2 changes: 1 addition & 1 deletion src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ use structopt::StructOpt;
)]
pub struct CommandLineArgs {
#[structopt(subcommand)]
pub cmd: Commands,
pub cmd: Option<Commands>,
}

#[derive(Debug, StructOpt, PartialEq)]
Expand Down
24 changes: 15 additions & 9 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,23 @@ fn main() {
let followers_db = FollowersDatabase::new();
let api = ApiClient::new();
match cmd {
Commands::Check => match check_handler(&followers_db, &api) {
Ok(_) => {}
Err(err) => print_error("Failed to check who unfollowed you", &err),
Some(cmd) => match cmd {
Commands::Check => match check_handler(&followers_db, &api) {
Ok(_) => {}
Err(err) => print_error("Failed to check who unfollowed you", &err),
},
Commands::Clear => match clear_handler(&followers_db) {
Ok(_) => {}
Err(err) => print_error("Failed to clear database", &err),
},
Commands::Status => match status_handler(&followers_db, &api) {
Ok(_) => {}
Err(err) => print_error("Failed to fetch status", &err),
},
},
Commands::Clear => match clear_handler(&followers_db) {
_ => match check_handler(&followers_db, &api) {
Ok(_) => {}
Err(err) => print_error("Failed to clear database", &err),
},
Commands::Status => match status_handler(&followers_db, &api) {
Ok(_) => {}
Err(err) => print_error("Failed to fetch status", &err),
Err(err) => print_error("Failed to check who unfollowed you", &err),
},
}
}

0 comments on commit de13daf

Please sign in to comment.