]> git.mxchange.org Git - friendica.git/commitdiff
Downgrade shebang from bin/bash to bin/sh
authorne20002 <ne20002@gmx.ch>
Thu, 6 Feb 2025 09:21:33 +0000 (09:21 +0000)
committerne20002 <ne20002@gmx.ch>
Thu, 6 Feb 2025 09:41:26 +0000 (09:41 +0000)
bin/console
bin/run_xgettext.sh

index 6d0d0887327d7ffb55b42ab95718b8c84c64bda8..82a0510c66b1aaa1673becebe576931d4440567e 100755 (executable)
@@ -1,14 +1,14 @@
-#!/bin/bash
+#!/bin/sh
 
 # SPDX-FileCopyrightText: 2010 - 2024 the Friendica project
 #
 # SPDX-License-Identifier: CC0-1.0
 
-dir=$(cd "${0%[/\\]*}" > /dev/null; pwd)
+dir=$(cd "$(dirname "$0")" > /dev/null 2>&1; pwd)
 
-if [[ -d /proc/cygdrive && $(which php) == $(readlink -n /proc/cygdrive)/* ]]; then
+if [ -d /proc/cygdrive ] && [ "$(which php)" = "$(readlink -n /proc/cygdrive)/*" ]; then
    # We are in Cygwin using Windows php, so the path must be translated
-   dir=$(cygpath -m "$dir");
+   dir=$(cygpath -m "$dir")
 fi
 
 php "${dir}/console.php" "$@"
index 1375f2b2760590ac55deaf6491cdc7dc138f1ff7..b947b43a357d0b7720d7e9f620618643f4d0bd1c 100755 (executable)
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/bin/sh
 
 # SPDX-FileCopyrightText: 2010 - 2024 the Friendica project
 #
@@ -6,8 +6,8 @@
 
 set -eo pipefail
 
-function resolve {
-       if [ "$(uname)" == "Darwin" ]
+resolve() {
+       if [ "$(uname)" = "Darwin" ]
        then
                realpath "$1"
        else
@@ -17,26 +17,26 @@ function resolve {
 
 FULLPATH=$(dirname "$(resolve "$0")")
 
-if [ "$1" == "--help" ] || [ "$1" == "-h" ]
+if [ "$1" = "--help" ] || [ "$1" = "-h" ]
 then
        echo "$(basename "$(resolve "$0")") [options]"
        echo
        echo "-a | --addon <name>       extract strings from addon 'name'"
-       echo "-s | --single                             single addon mode: extract string from current folder"
+       echo "-s | --single                     single addon mode: extract string from current folder"
        exit
 fi
 
 MODE='default'
 ADDONNAME=
-if [ "$1" == "--addon" ] || [ "$1" == "-a" ]
+if [ "$1" = "--addon" ] || [ "$1" = "-a" ]
 then
        MODE='addon'
-       if [ -z "$2" ]; then echo -e "ERROR: missing addon name\n\nrun_xgettext.sh -a <addonname>"; exit 1; fi
+       if [ -z "$2" ]; then echo "ERROR: missing addon name\n\nrun_xgettext.sh -a <addonname>"; exit 1; fi
        ADDONNAME=$2
        if [ ! -d "$FULLPATH/../addon/$ADDONNAME" ]; then echo "ERROR: addon '$ADDONNAME' not found"; exit 2; fi
 fi
 
-if [ "$1" == "--single" ] || [ "$1" == "-s" ]
+if [ "$1" = "--single" ] || [ "$1" = "-s" ]
 then
        MODE='single'
 fi
@@ -70,7 +70,6 @@ case "$MODE" in
        ;;
 esac
 
-
 KEYWORDS="-k -kt -ktt:1,2"
 
 echo "Extract strings to $OUTFILE.."
@@ -119,7 +118,7 @@ case "$MODE" in
        ;;
 esac
 
-if [ "" != "$1" ] && [ "$MODE" == "default" ]
+if [ -n "$1" ] && [ "$MODE" = "default" ]
 then
        UPDATEFILE="$(resolve "${FULLPATH}/$1")"
        echo "Merging new strings to $UPDATEFILE.."