From: Charles Hall Date: Thu, 8 Jun 2023 19:38:26 +0000 (-0700) Subject: make shebangs posix compliant (#2974) X-Git-Url: http://these/git/%22https:/nerdica.net/photo/contact/80/README.ja.md?a=commitdiff_plain;h=4e5798852f583a68d123a9c49ae0ef59ec9ffc76;p=lemmy.git make shebangs posix compliant (#2974) Previously, these scripts wouldn't work on exotic systems such as NixOS. ``` fd '\.sh$' -t f --exec sed -i 's@#!/bin/bash@#!/usr/bin/env bash@' ``` --- diff --git a/api_tests/prepare-drone-federation-test.sh b/api_tests/prepare-drone-federation-test.sh index afe18e1d..813b3b15 100755 --- a/api_tests/prepare-drone-federation-test.sh +++ b/api_tests/prepare-drone-federation-test.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash set -e export RUST_BACKTRACE=1 diff --git a/api_tests/run-federation-test.sh b/api_tests/run-federation-test.sh index ebde0c04..ed4bba41 100755 --- a/api_tests/run-federation-test.sh +++ b/api_tests/run-federation-test.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash set -e export LEMMY_DATABASE_URL=postgres://lemmy:password@localhost:5432 diff --git a/docker/docker_db_backup.sh b/docker/docker_db_backup.sh index 0bfa6802..8ec3e70c 100755 --- a/docker/docker_db_backup.sh +++ b/docker/docker_db_backup.sh @@ -1,2 +1,2 @@ -#!/bin/bash +#!/usr/bin/env bash docker-compose exec postgres pg_dumpall -c -U lemmy > dump_`date +%Y-%m-%d"_"%H_%M_%S`.sql diff --git a/docker/test_deploy.sh b/docker/test_deploy.sh index fe91ea31..ff4eb5b9 100755 --- a/docker/test_deploy.sh +++ b/docker/test_deploy.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash set -e export COMPOSE_DOCKER_CLI_BUILD=1 diff --git a/scripts/clear_db.sh b/scripts/clear_db.sh index b62490e1..dc53ee7e 100755 --- a/scripts/clear_db.sh +++ b/scripts/clear_db.sh @@ -1,3 +1,3 @@ -#!/bin/bash +#!/usr/bin/env bash psql -U lemmy -c "DROP SCHEMA public CASCADE; CREATE SCHEMA public; DROP SCHEMA utils CASCADE;" diff --git a/scripts/compilation_benchmark.sh b/scripts/compilation_benchmark.sh index af355734..93d1b6a2 100755 --- a/scripts/compilation_benchmark.sh +++ b/scripts/compilation_benchmark.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash set -e times=3 diff --git a/scripts/db-init.sh b/scripts/db-init.sh index 04ce7b90..e7c97392 100755 --- a/scripts/db-init.sh +++ b/scripts/db-init.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash set -e # Default configurations diff --git a/scripts/fix-clippy.sh b/scripts/fix-clippy.sh index d8591378..25b4b22c 100755 --- a/scripts/fix-clippy.sh +++ b/scripts/fix-clippy.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash set -e CWD="$(cd -P -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd -P)" diff --git a/scripts/install.sh b/scripts/install.sh index 2a839081..874776b1 100755 --- a/scripts/install.sh +++ b/scripts/install.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash set -e # Set the database variable to the default first. diff --git a/scripts/query_testing/apache_bench_report.sh b/scripts/query_testing/apache_bench_report.sh index d062a511..ae804a53 100755 --- a/scripts/query_testing/apache_bench_report.sh +++ b/scripts/query_testing/apache_bench_report.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash set -e declare -a arr=( diff --git a/scripts/query_testing/api_benchmark.sh b/scripts/query_testing/api_benchmark.sh index 9f06580a..4c1ee9e1 100755 --- a/scripts/query_testing/api_benchmark.sh +++ b/scripts/query_testing/api_benchmark.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash set -e # By default, this script runs against `http://127.0.0.1:8536`, but you can pass a different Lemmy instance, diff --git a/scripts/query_testing/views_old/generate_reports.sh b/scripts/query_testing/views_old/generate_reports.sh index 8d2b4a05..f52653f2 100755 --- a/scripts/query_testing/views_old/generate_reports.sh +++ b/scripts/query_testing/views_old/generate_reports.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash set -e # You can import these to http://tatiyants.com/pev/#/plans/new diff --git a/scripts/query_testing/views_to_diesel_migration/generate_reports.sh b/scripts/query_testing/views_to_diesel_migration/generate_reports.sh index 12993a08..aa443c1b 100755 --- a/scripts/query_testing/views_to_diesel_migration/generate_reports.sh +++ b/scripts/query_testing/views_to_diesel_migration/generate_reports.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash set -e # You can import these to http://tatiyants.com/pev/#/plans/new diff --git a/scripts/restore_db.sh b/scripts/restore_db.sh index a886fc08..f77624fb 100755 --- a/scripts/restore_db.sh +++ b/scripts/restore_db.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash psql -U lemmy -c "DROP SCHEMA public CASCADE; CREATE SCHEMA public;" cat docker/lemmy_dump_2021-01-29_16_13_40.sqldump | psql -U lemmy diff --git a/scripts/test.sh b/scripts/test.sh index e3239c7d..f117238b 100755 --- a/scripts/test.sh +++ b/scripts/test.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash set -e PACKAGE="$1" diff --git a/scripts/update_config_defaults.sh b/scripts/update_config_defaults.sh index 07aceb3e..024b8ca1 100755 --- a/scripts/update_config_defaults.sh +++ b/scripts/update_config_defaults.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash set -e dest=${1-config/defaults.hjson} diff --git a/scripts/update_translations.sh b/scripts/update_translations.sh index 71c62e99..1114f804 100755 --- a/scripts/update_translations.sh +++ b/scripts/update_translations.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash set -e pushd ../../lemmy-translations diff --git a/scripts/upgrade_deps.sh b/scripts/upgrade_deps.sh index 90adb896..0c4ae6f0 100755 --- a/scripts/upgrade_deps.sh +++ b/scripts/upgrade_deps.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash pushd ../