Skip to content

Commit

Permalink
Fix emojis not displaying and remove spelling mistakes
Browse files Browse the repository at this point in the history
Merge pull request #2 from fyndalf/dev
  • Loading branch information
fyndalf committed Mar 31, 2019
2 parents e51034c + 4a124c7 commit 209d766
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 119 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,6 @@ Cargo.lock

# These are backup files generated by rustfmt
**/*.rs.bk

# vscode
.vscode/
3 changes: 2 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ matrix:
#- env: TARGET=x86_64-unknown-netbsd DISABLE_TESTS=1

# Windows
#- env: TARGET=x86_64-pc-windows-gnu
- env: TARGET=x86_64-pc-windows-gnu

# Bare metal
# These targets don't support std and as such are likely not suitable for
Expand Down Expand Up @@ -124,6 +124,7 @@ branches:
# release tags
- /^v\d+\.\d+\.\d+.*$/
- master
- dev

notifications:
email:
Expand Down
4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
[package]
name = "autogit"
version = "0.1.0"
version = "0.1.1"
authors = ["Finn K <fyndalf@users.noreply.github.com>"]
edition = "2018"

[dependencies]
quicli= "0.4"
structopt = "0.2.14"
structopt = "0.2.15"
git2 = "0.8.0"
human-panic = "1.0.1"
console = "0.7.5"
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# autogit

[![Build Status](https://travis-ci.com/fyndalf/autogit.svg?token=pzxEnLQoVdYwoArquwFZ&branch=master)](https://travis-ci.com/fyndalf/autogit) [![Build status](https://ci.appveyor.com/api/projects/status/t6bbq1611o5mjvgk/branch/master?svg=true)](https://ci.appveyor.com/project/fyndalf/autogit/branch/master)

[![Build Status](https://travis-ci.com/fyndalf/autogit.svg?token=pzxEnLQoVdYwoArquwFZ&branch=master)](https://travis-ci.com/fyndalf/autogit)

Don't you hate having to navigate to every single git repository in your `projects` folder and update them all by hand?

Expand Down Expand Up @@ -62,4 +61,5 @@ is also encouraged.

## To Dos
- [ ] Add some tests
- [ ] Use git2 for fetching and pulling instead of bash-ed git commands
- [ ] Use git2 for fetching and pulling instead of bash-ed git commands
- [ ] Handle network errors and inform user
83 changes: 0 additions & 83 deletions appveyor.yml

This file was deleted.

23 changes: 0 additions & 23 deletions ci/before_deploy.ps1

This file was deleted.

17 changes: 10 additions & 7 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ use std::path::PathBuf;
use std::process::Command;
use structopt::StructOpt;

// Used for nice error messages
#[macro_use]
extern crate human_panic;

Expand All @@ -24,8 +25,10 @@ struct Cli {
force: bool,
}

static CHECK_BOX: Emoji = Emoji("✔", "");
static ERROR: Emoji = Emoji("x", "");
static SUCCESS: &'static str = "✅";
static FAILURE: &'static str = "❌";
static SUCCESS_EMOJI: Emoji = Emoji("✅", SUCCESS);
static FAILURE_EMOJI: Emoji = Emoji("❌", FAILURE);

fn main() -> CliResult {
setup_panic!();
Expand Down Expand Up @@ -57,11 +60,11 @@ fn main() -> CliResult {
spinner.set_prefix("");
spinner.set_message("");
spinner.finish_with_message("Finished updating");
println!("{} Updated {} repositories", CHECK_BOX, update_count);
println!("{} Updated {} repositories", SUCCESS_EMOJI, update_count);
Ok(())
}

// Recure through subdirectories up until given maximal depth
// Recurse through subdirectories up until given maximal depth
fn visit_dirs(
dir: &PathBuf,
depth: usize,
Expand All @@ -87,7 +90,7 @@ fn visit_dirs(
}
}
Err(e) => {
trace!("{} {:?}", ERROR, e); // errors are expected when folder is not a git directory
trace!("{} {:?}", FAILURE_EMOJI, e); // errors are expected when folder is not a git directory
if depth < max_depth {
visit_dirs(
&path,
Expand Down Expand Up @@ -138,7 +141,7 @@ fn check_if_repo_is_clean(dir: &PathBuf, progress_bar: &ProgressBar) -> Result<b
let cached_files_changed = cached_diff.stats()?.files_changed();

trace!(
"Numer of changed files:{}, number of changed cached files: {}",
"Number of changed files:{}, number of changed cached files: {}",
files_changed,
cached_files_changed
);
Expand All @@ -156,7 +159,7 @@ fn update_repo(
let branch_name = get_current_branch(&repo)?;
let path = dir.as_os_str().to_str().unwrap();

progress_bar.set_message("Updating ...");
progress_bar.set_message("Updating");
progress_bar.set_prefix(&format!("{} origin/{}", repo.path().display(), branch_name));

if force_update {
Expand Down

0 comments on commit 209d766

Please sign in to comment.