From 9453aa8b978f944df1ae28eeaf28120b91965c1f Mon Sep 17 00:00:00 2001 From: mrfry Date: Tue, 11 Apr 2023 20:37:12 +0200 Subject: [PATCH] replaced bash with sh in make --- make.sh | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/make.sh b/make.sh index c44c566..169f61d 100755 --- a/make.sh +++ b/make.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/sh scriptPath=$(dirname -- "${0}") domainPath="${scriptPath}/../../data/domain" userscriptPath="./user.js" @@ -11,20 +11,15 @@ if [ -z "${domain}" ] && [ -f "${domainPath}" ]; then fi if [ -z "${domain}" ]; then - echo -e "\033[0;41mDOMAIN is not set, and ${domainPath} does not exist!\033[0m" + printf "\033[0;41mDOMAIN is not set, and %s does not exist!\033[0m\n" "${domainPath}" exit 1 fi if [ ! -f "${userscriptPath}" ]; then - echo -e "\033[0;41m${userscriptPath} does not exist!\033[0m" + printf "\033[0;41m%s does not exist!\033[0m\n" "${userscriptPath}" exit 1 fi -userscript=$(cat "${userscriptPath}") - -toReplace="[DOMAIN]" -result="${userscript//"$toReplace"/"$domain"}" - -echo "$result" > "${resultUserscriptPath}" +sed "s/\[DOMAIN\]/${domain}/g" "${userscriptPath}" > "${resultUserscriptPath}" echo "Exported with domain: '${domain}' to '${resultUserscriptPath}'"