puck is a zsh prompt
Work in progress 🧐
It'll look something like this:
~/Dev/Repo/Private/puck :git branch info here:
λ Typing commands goes here!
Q: Why would you do this in OCaml instead of just using
zshoroh-my-zsh?A: Because I can?
A: OCaml is fun and building a simple program that outputs a string is good for learning more OCaml! I was inspired by
gbt.
Project setup inspired by spin and modern-ocaml. Thanks to tmattio and Khady 🥳
Right now the only way to use puck is to build from source:
npm i -g esy
git clone https://github.com/p1xelHer0/puck.git
cd puck
esyThis will install the OCaml compiler and required dependencies, it might take some minutes. After the initial installation this will be much faster. esy uses dune behind the scenes, the de facto build system for OCaml.
Build the puck executable and source the puck.zsh file to enable the prompt. See Build for more information.
esy build
# read the contents of ./puck.zsh
# in your .zshrc
source /path/to/puck/puck.zshNote: if you don't want to use
esyfor some reason then you can useduneitself. If you have this opinion you problably know how to do it yourself 😘. I'm might look into getting this working with bothduneandesyin the future with proper documentation.
This project is built with and tested using
esywith these versions:
- macOS Mojave Version
10.14.6esy@0.6.4installed withyarn@1.22.4zsh 5.3 (x86_64-apple-darwin18.0)
esy buildThis will build puck with the name main.exe, the puck executable will be put in the ./_build/ folder. The complete path is:
./_build/default/bin/main.exeesy testThis will run all unit tests. puck uses alcotest for testing.
All unit tests can be found in the ./test folder. The test runner executable is found under ./test/support/test_runner.ml, test suits should be added there.
esy formatThis will format all ml and mli files in the repository. puck uses ocamlformat for formatting. The formatted changes will be shown in the output.