make scripts and script execution nix compatible

This commit is contained in:
2025-05-19 11:59:12 -07:00
parent adb7f61436
commit 24f44ec093
4 changed files with 11 additions and 11 deletions

View File

@ -8,7 +8,7 @@
(defn execute-bash [data]
(sub r"\$\[(.*?)\]" (fn [sequence]
(. (check-output (.group sequence 1) :shell True :executable "/bin/bash" :env hy-env) (decode) (strip)))
(. (check-output (.group sequence 1) :shell True :executable "bash" :env hy-env) (decode) (strip)))
data))
(defn parse-html-file [path #** kwargs]

View File

@ -8,4 +8,4 @@
(setv env hy-env)
(setv (get env "PATH") (+ (get hy-env "PATH") ":./scripts"))
(print (sub r"\$\[(.*?)\]" (fn [sequence] (. (check-output (.group sequence 1) :shell True :executable "/bin/bash" :env env) (decode) (strip))) (with [fp (open (get argv 1) "r")] (.read fp))))
(print (sub r"\$\[(.*?)\]" (fn [sequence] (. (check-output (.group sequence 1) :shell True :executable "bash" :env env) (decode) (strip))) (with [fp (open (get argv 1) "r")] (.read fp))))

View File

@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
path=$1
caption=$2

View File

@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
tmpfile=$(mktemp)
timeout 0.6s nvim "$1" -c "set nonu | set nornu" -c "autocmd LspAttach * execute 'TOhtml | w! ${tmpfile} | qa!'" >/dev/null || nvim "$1" -c "set nonu | set nornu" -c "TOhtml | w! ${tmpfile} | qa!" >/dev/null