14 Commits

Author SHA1 Message Date
81e05cf859 chore(release) git pull should not cause error if no upstream 2022-12-21 10:06:09 +01:00
64897d32e4 chore(release) fix errors 2022-12-19 10:11:05 +01:00
0408fe856d chore(release) with updated formula for sourcegraph tap 2022-12-19 09:20:58 +01:00
4e3b711567 chore(release) with dependencies v0.1.7
All checks were successful
continuous-integration/drone/push Build is passing
2022-12-18 23:18:42 +01:00
7f0bff57eb forgot string
All checks were successful
continuous-integration/drone/push Build is passing
2022-12-18 23:18:05 +01:00
92f167e7e8 fix name of drone
All checks were successful
continuous-integration/drone/push Build is passing
2022-12-18 23:14:11 +01:00
c7ebd6350e chore(release) v0.1.6
Some checks failed
continuous-integration/drone/push Build is failing
continuous-integration/drone/tag Build is failing
2022-12-18 23:10:29 +01:00
d7d55d24f5 with proper name for version
Some checks failed
continuous-integration/drone/push Build is failing
continuous-integration/drone Build is failing
2022-12-18 23:01:43 +01:00
6381c189cb correct binName
Some checks failed
continuous-integration/drone Build is failing
2022-12-18 22:54:52 +01:00
d0568e48ec with drone 2022-12-18 22:54:28 +01:00
f66a6c858d chore(release) with dependencies v0.1.5 2022-12-18 22:53:14 +01:00
267d546d2e chore(release) with dependencies 2022-12-18 22:49:48 +01:00
87c9c36f6c Add new dependencies 2022-12-18 22:48:29 +01:00
2f19707e94 chore(release) with updated version 2022-12-18 22:40:18 +01:00
11 changed files with 87 additions and 12 deletions

5
.drone.yml Normal file
View File

@@ -0,0 +1,5 @@
kind: template
load: bust_rustbin_default_template.yaml
name: toolkit
data:
binName: toolkit

View File

@@ -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.
@@ -33,7 +33,15 @@ jobs:
# Custom dependencies in case other formulas are needed to build the current one.
# Optional - multiline string.
#depends_on: |
depends_on: |
"fzf"
"gh"
"dust"
"bottom"
"procs"
"sourcegraph/src-cli/src-cli"
"tokei"
"bandwhich"
# Custom install command for your formula.
# Required - string.

View File

@@ -110,5 +110,5 @@ jobs:
*.deb
*.tar.gz
*.zip
name: ${{ steps.get_version.outputs.value }}
name: v${{ steps.get_version.outputs.value }}
tag_name: v${{ steps.get_version.outputs.value }}

2
Cargo.lock generated
View File

@@ -316,7 +316,7 @@ dependencies = [
[[package]]
name = "toolkit"
version = "0.1.2"
version = "0.1.10"
dependencies = [
"clap",
"eyre",

View File

@@ -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.2"
version = "0.1.10"
edition = "2021"
license-file = "LICENSE"
authors = ["Kasper J. Hermansen contact@kjuulh.io"]

View File

@@ -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/<username>/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/<username>/git/github.com/kjuulh`.
You will also require other integration such as a GitHub integration through
`gh`.
## Usage
```
Usage: toolkit <COMMAND>
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)

BIN
assets/demo.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 MiB

View File

@@ -202,12 +202,12 @@ impl FuzzyClone {
}),
)?;
} else {
util::shell::run(
let _ = util::shell::run(
&["git", "pull"],
Some(util::shell::RunOptions {
path: git_repo_path.clone(),
}),
)?;
);
}
Ok(git_repo_path)

View File

@@ -2,13 +2,13 @@ pub struct Perf;
impl Perf {
fn run() -> eyre::Result<()> {
if let Err(_) = util::shell::run_with_input_and_output(&["ytop", "--version"], "".into()) {
if let Err(_) = util::shell::run_with_input_and_output(&["btm", "--version"], "".into()) {
return Err(eyre::anyhow!(
"could not find ytop, please install or add to PATH"
"could not find btm, please install or add to PATH"
));
}
util::shell::run(&["ytop"], None)?;
util::shell::run(&["btm"], None)?;
Ok(())
}

View File

@@ -8,7 +8,7 @@ impl Procs {
));
}
util::shell::run(&["procs"], None)?;
util::shell::run_with_input(&["procs"], "".into())?;
Ok(())
}

View File

@@ -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(