From 4924f22b4808a1975518873aefbc3b69246822ef Mon Sep 17 00:00:00 2001 From: Francis Begyn Date: Tue, 19 Apr 2022 19:17:27 +0200 Subject: [PATCH] make shell scripts portable The current shell scripts call `/bin/bash`. This won't work on certain systems (`nixos` for example :eyes:). By switching to `/usr/bin/env bash` these scripts become portable. As long as `bash` environment is present on a system, the scripts will work. --- first-setup.sh | 2 +- parse_hlds.sh | 2 +- populate-db.sh | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/first-setup.sh b/first-setup.sh index dbb4155..0622dda 100755 --- a/first-setup.sh +++ b/first-setup.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash set -euo pipefail # A simple file to run all instructions from the README ## this should be run in the root of the repository diff --git a/parse_hlds.sh b/parse_hlds.sh index b0c3188..f9b7898 100755 --- a/parse_hlds.sh +++ b/parse_hlds.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash set -euo pipefail # args = map(lambda arg: arg if x[0] in "/-" else pwd+arg, sys.argv[1:]) diff --git a/populate-db.sh b/populate-db.sh index 400ce2e..4c0aff4 100755 --- a/populate-db.sh +++ b/populate-db.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash set -euo pipefail cd "$(dirname "$0")/app"