From bef7e1d083d5f6a6d6030293300938f87dd5d042 Mon Sep 17 00:00:00 2001 From: Duck Nebuchadnezzar Date: Fri, 30 Aug 2024 12:51:36 -0400 Subject: [PATCH] Replace references to /bin/bash with /usr/bin/env bash /bin/bash is not available on all distros. (eg. NixOS) --- backend/src/rvbbit_backend/core.clj | 16 ++++++++-------- backend/src/rvbbit_backend/websockets.clj | 4 ++-- compile_all.sh | 2 +- zprint-config.sh | 2 +- zprint-flows.sh | 2 +- zprint-screens.sh | 2 +- 6 files changed, 14 insertions(+), 14 deletions(-) diff --git a/backend/src/rvbbit_backend/core.clj b/backend/src/rvbbit_backend/core.clj index 92bcd137..da92ba65 100644 --- a/backend/src/rvbbit_backend/core.clj +++ b/backend/src/rvbbit_backend/core.clj @@ -654,7 +654,7 @@ ;; (println " ") ;; (wss/fig-render "Curiouser and curiouser!" :pink) - (shell/sh "/bin/bash" "-c" (str "rm -rf " "live/*")) + (shell/sh "/usr/bin/env" "bash" "-c" (str "rm -rf " "live/*")) (qp/create-slot-queue-system) (fpop/thaw-flow-results) @@ -1108,13 +1108,13 @@ (ut/zprint-file "./defs/signals.edn" {:style [:justified-original] :parse-string? true :comment {:count? nil :wrap? nil} :width 120 :map {:comma? false :sort? false}}) (ut/zprint-file "./defs/solvers.edn" {:style [:justified-original] :parse-string? true :comment {:count? nil :wrap? nil} :width 120 :map {:comma? false :sort? false}}) ;(ut/ppa [:clearing-cache-db]) - ;(shell/sh "/bin/bash" "-c" (str "rm " "db/cache.db")) - (shell/sh "/bin/bash" "-c" (str "rm " "flow-logs/*")) - (shell/sh "/bin/bash" "-c" (str "rm " "reaction-logs/*")) - ;(shell/sh "/bin/bash" "-c" (str "rm " "status-change-logs/*")) - (shell/sh "/bin/bash" "-c" (str "rm " "tracker-logs/*")) - (shell/sh "/bin/bash" "-c" (str "rm " "reaction-logs/*")) - ;(shell/sh "/bin/bash" "-c" (str "rm " "db/system.db")) + ;(shell/sh "/usr/bin/env" "bash" "-c" (str "rm " "db/cache.db")) + (shell/sh "/usr/bin/env" "bash" "-c" (str "rm " "flow-logs/*")) + (shell/sh "/usr/bin/env" "bash" "-c" (str "rm " "reaction-logs/*")) + ;(shell/sh "/usr/bin/env" "bash" "-c" (str "rm " "status-change-logs/*")) + (shell/sh "/usr/bin/env" "bash" "-c" (str "rm " "tracker-logs/*")) + (shell/sh "/usr/bin/env" "bash" "-c" (str "rm " "reaction-logs/*")) + ;(shell/sh "/usr/bin/env" "bash" "-c" (str "rm " "db/system.db")) )) (ppy/add-watch+ diff --git a/backend/src/rvbbit_backend/websockets.clj b/backend/src/rvbbit_backend/websockets.clj index 6e537bdb..cbcd5894 100644 --- a/backend/src/rvbbit_backend/websockets.clj +++ b/backend/src/rvbbit_backend/websockets.clj @@ -1248,7 +1248,7 @@ [command] (let [;;shell (or (System/getenv "SHELL") "/bin/sh") ;;output (shell/sh shell "-c" (str "mkdir -p shell-root ; cd shell-root ; " command)) - output (shell/sh "/bin/bash" "-c" (str "mkdir -p shell-root ; cd shell-root ; " command)) + output (shell/sh "/usr/bin/env" "bash" "-c" (str "mkdir -p shell-root ; cd shell-root ; " command)) split-lines (vec (remove empty? (cstr/split-lines (get output :out)))) exit-code (get output :exit) error (vec (remove empty? (cstr/split-lines (get output :err)))) @@ -7441,7 +7441,7 @@ [command] (let [;;shell (or (System/getenv "SHELL") "/bin/sh") ;;output (shell/sh shell "-c" (str "mkdir -p shell-root ; cd shell-root ; " command)) - output (shell/sh "/bin/bash" "-c" (str "mkdir -p shell-root ; cd shell-root ; " command)) + output (shell/sh "/usr/bin/env" "bash" "-c" (str "mkdir -p shell-root ; cd shell-root ; " command)) split-lines (vec (remove empty? (cstr/split-lines (get output :out)))) exit-code (get output :exit) error (vec (remove empty? (cstr/split-lines (get output :err)))) diff --git a/compile_all.sh b/compile_all.sh index ed12d1bb..279875f5 100755 --- a/compile_all.sh +++ b/compile_all.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # Check if the current directory path ends with "rvbbit" if [[ "${PWD}" != */rvbbit ]]; then diff --git a/zprint-config.sh b/zprint-config.sh index 14103688..71639e63 100755 --- a/zprint-config.sh +++ b/zprint-config.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash DIRECTORY="backend/defs" diff --git a/zprint-flows.sh b/zprint-flows.sh index 6354b557..5dca72f7 100755 --- a/zprint-flows.sh +++ b/zprint-flows.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash DIRECTORY="backend/flows" diff --git a/zprint-screens.sh b/zprint-screens.sh index ba2186ac..59e0dbae 100755 --- a/zprint-screens.sh +++ b/zprint-screens.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash DIRECTORY="backend/screens"