Crates.io | pono |
lib.rs | pono |
version | 0.3.0 |
source | src |
created_at | 2024-09-17 12:00:58.7612 |
updated_at | 2024-09-19 17:40:15.170728 |
description | pono - pack and organize symlinks once |
homepage | |
repository | https://github.com/cristianoliveira/pono |
max_upload_size | |
id | 1377368 |
size | 58,816 |
pono (poh-no to place/store in latin) is a cli for managing symbolic links in one place inspired by stow
. Because symbolic links managment in bash script sucks.
Let's face it, managing symbolic links with bash scripts sucks because ln
has poor defaults. The alternative GNU stow does almost what I wanted, but not quite. I wanted a tool that could manage symlinks for multiple packages independent of the source file structure, using a flat configuration. I also need to be able to toogle links on demand to apply different configs.
Create the pono.toml
in the current directory
[ponos]
nvim = { source = "./examples/from/nvim", target = "./examples/to/nvim" }
zsh = { source = "./examples/from/zshrc", target = "./examples/to/.zshrc" }
And run
pono enable -c example/pono.toml
Linking packages
nvim: ./examples/to/nvim (new link)
zsh: ./examples/to/.zshrc (new link)
ls -la examples/to [1:00:35]
total 0
drwxr-xr-x 4 cris 128 Sep 14 01:00 .
drwxr-xr-x 5 cris 160 Sep 14 01:00 ..
lrwxr-xr-x 1 cris 58 Sep 14 01:00 .zshrc -> /home/cris/pono/./examples/src/zshrc
lrwxr-xr-x 1 cris 57 Sep 14 01:00 nvim -> /home/cris/pono/./examples/src/nvim
cr
You can install pono using Cargo:
cargo install pono
You can install pono using Nix:
nix profile install github:cristianoliveira/pono#pono
Enable pono completions for your shell by adding the following to your shell configuration file:
if command -v pono &> /dev/null; then
eval "$(pono completions)" ## or $(pono completions <shell>)
fi
Check pono --help
for more information.
The pono CLI allows you to install, remove, and check symlinks based on a TOML configuration file.
enable
: Create symbolic links for the defined ponos.disable
: Remove symbolic links for the defined ponos.toggle
: Toggle a given ponoa and verify.status
: Check the status the define ponos.list
: Display all available ponos from the TOML configuration.-c --config <file>
: Specify a custom TOML configuration file (default: ./pono.toml
).--help
: Display help information.To create symlinks for all packages defined in pono.toml
:
pono enable
To enable symlinks for specific packages:
pono enable package1 package2
To remove symlinks for all packages:
pono disable
To disable specific packages:
pono disable package1
To check the status of all symlinks:
pono status
# OR
pono status package1 package2
To list all available packages from the TOML configuration:
pono list
For more detailed command usage, run:
pono --help
The configuration is defined in a pono.toml
file. It specifies the source directories for your packages and where the symlinks should be created.
pono.toml
:[ponos.package1]
source = "path/to/package1"
target = "/usr/local/bin"
[ponos.package2]
source = "path/to/package2"
target = "/home/user/.config"
[ponos.package3]
source = "path/to/package3"
target = "/opt/tools"
To build the project from source, you will need to have Rust installed on your system. You can then clone the repository and build the project using Cargo:
cargo build --release
To run the test suite, you can use the following command:
cargo test
The project uses rustfmt
for code formatting. You can run the following command to format the code:
cargo fmt
pono is licensed under the MIT License.