add setup for the pre-commit hook to just setup
This commit is contained in:
parent
241d2180a7
commit
f60c7bfce7
|
@ -16,24 +16,21 @@
|
|||
''
|
||||
#! ~/.nix-profile/bin/zsh
|
||||
is_new() {
|
||||
new=1;
|
||||
touch /tmp/rjh;
|
||||
while IFS="" read -r p || [ -n "$p" ]; do
|
||||
if [ $(pwd) = $p ]; then
|
||||
new=0;
|
||||
mkdir -p /tmp/rjh;
|
||||
if [[ -a "/tmp/rjh/$(pwd | tr \"/\" -).json" ]]; then
|
||||
new=1
|
||||
fi
|
||||
done < /tmp/rjh
|
||||
return $new
|
||||
}
|
||||
|
||||
send_to_jupyter() {
|
||||
is_new && zellij run -f -n "jupyter console" -- direnv exec . jupyter console --kernel="$1" -f="/tmp/rjh-$(pwd | tr \"/\" -).json" --ZMQTerminalInteractiveShell.include_other_output=True --ZMQTerminalInteractiveShell.other_output_prefix=''' && zellij action write 29 25 && zellij action write 17
|
||||
pwd >> /tmp/rjh
|
||||
zellij action write 29 25
|
||||
zellij action write 17
|
||||
cat | just send
|
||||
}
|
||||
send_to_jupyter
|
||||
is_new && zellij run -f -n "jupyter console" -- direnv exec . jupyter console --kernel="$1" -f="/tmp/rjh/$(pwd | tr \"/\" -).json" --ZMQTerminalInteractiveShell.include_other_output=True --ZMQTerminalInteractiveShell.other_output_prefix=''' && sleep 3
|
||||
rm -f /tmp/pipe-rjh
|
||||
mkfifo /tmp/pipe-rjh
|
||||
cat > /tmp/pipe-rjh
|
||||
zellij run -f -n "REPL" -- direnv exec . just send < /tmp/pipe-rjh
|
||||
rm /tmp/pipe-rjh
|
||||
|
||||
'';
|
||||
in {
|
||||
programs.helix = {
|
||||
|
|
Loading…
Reference in a new issue