All Projects → nakabonne → rhack

nakabonne / rhack

Licence: BSD-3-Clause License
Temporary edit external crates that your project depends on

Programming Languages

rust
11053 projects
Makefile
30231 projects

Projects that are alternatives of or similar to rhack

Cargo Watch
🔭🚢 Watches over your Cargo project's source.
Stars: ✭ 1,281 (+1131.73%)
Mutual labels:  cargo, developer-tools
alfred
(v0.2) Even Batman needs a little help. Task runner. Automator. Build system.
Stars: ✭ 62 (-40.38%)
Mutual labels:  developer-tools
dotfiles
My personal app/env configs and dotfiles.
Stars: ✭ 27 (-74.04%)
Mutual labels:  developer-tools
project
☕️ Create node, rust, python or ruby project locally and on github (private or public)
Stars: ✭ 19 (-81.73%)
Mutual labels:  cargo
hubi
Humanitarian ubiquitous language helper
Stars: ✭ 17 (-83.65%)
Mutual labels:  developer-tools
Mac-OS-Setup-Applications
👾 All I need to setup a new Mac and the applications I use everyday as a Web Developper
Stars: ✭ 96 (-7.69%)
Mutual labels:  developer-tools
wordup-code
Visual Studio Code extension for wordup that makes it easy to develop, manage and export WordPress plugins or themes.
Stars: ✭ 12 (-88.46%)
Mutual labels:  developer-tools
docker-dev
A local Docker Environment for building PHP applications 🔨
Stars: ✭ 97 (-6.73%)
Mutual labels:  developer-tools
bom
JENKINS-47498: allow plugin dependencies to be specified via BOM
Stars: ✭ 26 (-75%)
Mutual labels:  developer-tools
tbot
Automation/Testing tool for Embedded Linux Development
Stars: ✭ 54 (-48.08%)
Mutual labels:  developer-tools
mixed-content-scanner-cli
A cli tool to check your site for mixed content
Stars: ✭ 82 (-21.15%)
Mutual labels:  developer-tools
fe
A super-fast and easy to use command line fuzzy file searcher built with the rust programming language.
Stars: ✭ 23 (-77.88%)
Mutual labels:  cargo
approveapi-go
A Go library for using ApproveAPI
Stars: ✭ 16 (-84.62%)
Mutual labels:  developer-tools
cargo-testify
Watches changes in a rust project, runs test and shows friendly notification
Stars: ✭ 76 (-26.92%)
Mutual labels:  cargo
copy-host
Chrome extension to copy hostname of the current tab to your clipboard.
Stars: ✭ 18 (-82.69%)
Mutual labels:  developer-tools
legesher
Because language shouldn't be a barrier to code
Stars: ✭ 29 (-72.12%)
Mutual labels:  developer-tools
AutoBrew
AutoBrew: Homebrew deployments made easy
Stars: ✭ 71 (-31.73%)
Mutual labels:  developer-tools
mockify
Easy, configurable API mocking you can change on-the-fly
Stars: ✭ 83 (-20.19%)
Mutual labels:  developer-tools
stack-attack
A WIP CLI tool that manages stacked pull requests. Using stacked PRs is now (many small) pieces of cake
Stars: ✭ 39 (-62.5%)
Mutual labels:  developer-tools
nixcrates
DEPRECATED reads rust-lang/crates.io-index and outputs nix expressions into fractalide/nix-crates-index
Stars: ✭ 14 (-86.54%)
Mutual labels:  cargo

rhack

Version info

You want to quickly put a sneaky macro kind of like dbg! into external crates to find out how some internal data structure works? If so rhack is for you!

rhack makes it easier to edit external crates code that your project depends on.

Usage

Let's say you want to modify the reqwest crate.

[dependencies]
reqwest = "0.11"

Run the following:

$ rhack edit reqwest

This will make a copy of the crate into $HOME/.rhack/reqwest-0.11.1 and add its path to the [patch] section in your Cargo.toml whose path is automatically detected:

[patch.crates-io]
reqwest = { path = "/home/you/.rhack/reqwest-0.11.1" }

Now your package uses the locally checked out copy instead of one from crates.io. You can now open the files (typically by leveraging the "Jump to Definition" feature) and then feel free to modify the source code.

Undoing

Simply run the undo command then you can undo all of the changes to your Cargo.toml:

$ rhack undo

Keep in mind that this command doesn't remove any copy of crates.

Settings

It uses $HOME/.rhack as the destination to copy the source code of the external crates by default. You can change it by setting and exposing the $RHACK_DIR environment variable.

Installation

For MacOS, Linux, and Windows, prebuilt binaries are available through here.

Debian/Ubuntu

wget https://github.com/nakabonne/rhack/releases/download/v0.1.0/rhack_linux_amd64.deb
apt install ./rhack_linux_amd64.deb

Arch Linux

An AUR package is available.

yay rhack

Cargo

cargo install rhack

From source

git clone https://github.com/nakabonne/rhack.git
cargo build --release
sudo install -m755 target/release/rhack /usr/local/bin/rhack

If you want to generate the man page, you can install it with scdoc.

sudo mkdir -p /usr/local/share/man/man1
scdoc < rhack.1.scd > rhack.1
sudo install -m644 rhack.1 /usr/local/share/man/man1/rhack.1

Acknowledgements

This tool is highly inspired by gohack. It clearly stimulated an incentive to creation. A big "thank you!" goes out to them.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].