From 52c09d888e2bdd2389084165d982a3855820a401 Mon Sep 17 00:00:00 2001 From: bad Date: Wed, 22 Sep 2021 14:52:03 +0200 Subject: [PATCH] Switch to using #!/usr/bin/env bash This fixes http.sh on nixos, macos and probably a few other systems --- http.sh | 6 +++--- src/account.sh | 2 +- src/mail.sh | 2 +- src/mime.sh | 2 +- src/misc.sh | 2 +- src/response/proxy.sh | 2 +- src/route.sh | 2 +- src/server.sh | 2 +- src/template.sh | 2 +- src/worker.sh | 2 +- templates/head.sh | 2 +- 11 files changed, 13 insertions(+), 13 deletions(-) diff --git a/http.sh b/http.sh index 5ba36d4..ff85331 100755 --- a/http.sh +++ b/http.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash trap ctrl_c INT if [[ ! -f "config/master.sh" ]]; then @@ -100,12 +100,12 @@ if [[ $1 == "init" ]]; then # will get replaced with proper parameter parsing in LauraIsCute cat < "${cfg[namespace]}/workers/example/worker.sh" -#!/bin/bash +#!/usr/bin/env bash date LauraIsCute cat < "${cfg[namespace]}/${cfg[root]}/index.shs" -#!/bin/bash +#!/usr/bin/env bash source templates/head.sh echo "

Hello from HTTP.sh!


To get started with your app, check out $(pwd)/${cfg[namespace]}/
  • $(pwd)/${cfg[namespace]}/${cfg[root]} - your (public) files go here
  • diff --git a/src/account.sh b/src/account.sh index cec2b31..d423c57 100755 --- a/src/account.sh +++ b/src/account.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # account.sh - account and session mgmt diff --git a/src/mail.sh b/src/mail.sh index 420bfd4..95b6bbe 100755 --- a/src/mail.sh +++ b/src/mail.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # mail.sh - basic SMTP handler # mailgen(from, to, subject, msg) diff --git a/src/mime.sh b/src/mime.sh index e3a469c..566706f 100755 --- a/src/mime.sh +++ b/src/mime.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # mime.sh - determine what Content-Type should be passed on # diff --git a/src/misc.sh b/src/misc.sh index ee13638..e102cf4 100755 --- a/src/misc.sh +++ b/src/misc.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # misc.sh - miscellaneous functions # set_cookie(cookie_name, cookie_content) diff --git a/src/response/proxy.sh b/src/response/proxy.sh index 755557a..1ee601b 100755 --- a/src/response/proxy.sh +++ b/src/response/proxy.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash url="$(url_decode "$(url_decode "$(sed -E 's/\?/��Lun4_iS_CuTe�/;s/^(.*)��Lun4_iS_CuTe�//;s/'"${cfg[proxy_param]}"'=//g' <<< "${r[url]}")")")" if [[ $(grep -Poh "${cfg[proxy_url]}" <<< "$url") == '' ]]; then diff --git a/src/route.sh b/src/route.sh index 701caa0..ab3160b 100755 --- a/src/route.sh +++ b/src/route.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # route.sh - basic router stub # router(uri, path) diff --git a/src/server.sh b/src/server.sh index 9d38ba0..018f4cf 100755 --- a/src/server.sh +++ b/src/server.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash source config/master.sh source src/mime.sh source src/misc.sh diff --git a/src/template.sh b/src/template.sh index d75434a..eedee09 100755 --- a/src/template.sh +++ b/src/template.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # template.sh - basic templating engine # render(array, template_file) diff --git a/src/worker.sh b/src/worker.sh index dec4363..3545ddb 100755 --- a/src/worker.sh +++ b/src/worker.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # worker.sh - setup and control of workers diff --git a/templates/head.sh b/templates/head.sh index 2b4b1e5..1e74485 100755 --- a/templates/head.sh +++ b/templates/head.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash echo '