diff --git a/.github/workflows/release-published.yml b/.github/workflows/release-published.yml index cde5078..64f43cf 100644 --- a/.github/workflows/release-published.yml +++ b/.github/workflows/release-published.yml @@ -16,7 +16,7 @@ jobs: # The name of the homebrew tap to publish your formula to as it appears on GitHub. # Required - strings. homebrew_owner: kjuulh - homebrew_tap: brew + homebrew_tap: homebrew-brew # The name of the folder in your homebrew tap where formula will be committed to. # Default is shown - string. @@ -40,6 +40,8 @@ jobs: "bottom" "procs" "sourcegraph/src-cli/src-cli" + "tokei" + "bandwhich" # Custom install command for your formula. # Required - string. diff --git a/Cargo.lock b/Cargo.lock index b4c15cb..b6a1082 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -316,7 +316,7 @@ dependencies = [ [[package]] name = "toolkit" -version = "0.1.8" +version = "0.1.9" dependencies = [ "clap", "eyre", diff --git a/Cargo.toml b/Cargo.toml index 555eb5a..68bb550 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "toolkit" description = "Toolkit is an opinionated toolkit complementing a personal development workflow. Many of the commands are quite verbose, and well suited for adding to your shell toolbelt" -version = "0.1.8" +version = "0.1.9" edition = "2021" license-file = "LICENSE" authors = ["Kasper J. Hermansen contact@kjuulh.io"] diff --git a/README.md b/README.md index 56132a8..0aa60e0 100644 --- a/README.md +++ b/README.md @@ -1 +1,61 @@ # Toolkit + +This is an opinionated toolkit, which reflect my (@kjuulh) way of working. This +project aims to enhance a general workflow, and provides tools that may be +useful outside of project work. For project work see repo:kjuulh/bust or +repo:kjuulh/char, which aims for the same thing, but for projects themselves. + +## Install + +Currenly I only publish homebrew packages, however, all artifacts are released +via. released, that includes deb packages as well. + +### Homebrew + +``` +brew install kjuulh/brew/toolkit +``` + +## Configuration + +To use toolkit you will need a series of environment variables, they are only +needed if you need the associated tool. + +``` +export SRC_ENDPOINT=https://sourcegraph.com +export SRC_ACCESS_TOKEN= +export GITHUB_FC_ROOT="/Users//git/github.com" +export GITHUB_FC_ORGS="kjuulh" +``` + +`SRC` is sourcegraph integration. The endpoint is either to the public instance, +or your own domain. The access token is a personal access token. If either of +these are missing. A prompt will be shown on the first run + +`GITHUB_FC` is the fuzzy clone setup. First is the destination path, this is +where the orgs will be placed. Second is ORGS, that is which orgs to subscribe +to. The total path in this case will end up being +`/Users//git/github.com/kjuulh`. + +You will also require other integration such as a GitHub integration through +`gh`. + +## Usage + +``` +Usage: toolkit + +Commands: + prereqs + tldr + sourcegraph + github + stats + init + help Print this message or the help of the given subcommand(s) + +Options: + -h, --help Print help information +``` + +![demo](assets/demo.gif) diff --git a/assets/demo.gif b/assets/demo.gif new file mode 100644 index 0000000..d3a57ad Binary files /dev/null and b/assets/demo.gif differ diff --git a/crates/stats/src/perf.rs b/crates/stats/src/perf.rs index c765034..9bfcb22 100644 --- a/crates/stats/src/perf.rs +++ b/crates/stats/src/perf.rs @@ -2,14 +2,13 @@ pub struct Perf; impl Perf { fn run() -> eyre::Result<()> { - if let Err(_) = util::shell::run_with_input_and_output(&["bottom", "--version"], "".into()) - { + if let Err(_) = util::shell::run_with_input_and_output(&["btm", "--version"], "".into()) { return Err(eyre::anyhow!( - "could not find bottom, please install or add to PATH" + "could not find btm, please install or add to PATH" )); } - util::shell::run(&["bottom"], None)?; + util::shell::run(&["btm"], None)?; Ok(()) } diff --git a/crates/stats/src/procs.rs b/crates/stats/src/procs.rs index 76fd33d..be92776 100644 --- a/crates/stats/src/procs.rs +++ b/crates/stats/src/procs.rs @@ -8,7 +8,7 @@ impl Procs { )); } - util::shell::run(&["procs"], None)?; + util::shell::run_with_input(&["procs"], "".into())?; Ok(()) } diff --git a/crates/tldr/src/update.rs b/crates/tldr/src/update.rs index 51fa1c2..9a6d1c5 100644 --- a/crates/tldr/src/update.rs +++ b/crates/tldr/src/update.rs @@ -12,7 +12,9 @@ impl util::Cmd for Update { let mut tldr_cache_dir = cache_dir.clone(); tldr_cache_dir.push("kah-toolkit/tldr/store/"); - std::fs::remove_dir_all(&tldr_cache_dir)?; + if let Err(_) = std::fs::remove_dir_all(&tldr_cache_dir) { + // ignored + } std::fs::create_dir_all(&tldr_cache_dir)?; util::shell::run(