From 8e3ac201454aea640a5d75475e8c7d9b5c2d36ca Mon Sep 17 00:00:00 2001 From: Dom Rodriguez Date: Fri, 19 May 2023 00:45:38 +0100 Subject: [PATCH] refactor(scripts): Use `#!/usr/bin/env` as part of shebang This resolves build errors in systems like NixOS, where `/bin/bash` doesn't exist. --- backup.sh | 2 +- build.sh | 2 +- clear.sh | 2 +- convert.sh | 2 +- download.sh | 2 +- start_dev.sh | 2 +- uart_log.sh | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/backup.sh b/backup.sh index e44b45c..aca332a 100755 --- a/backup.sh +++ b/backup.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash BKPPATH="firmware-backups" diff --git a/build.sh b/build.sh index 064cec6..b8b8222 100755 --- a/build.sh +++ b/build.sh @@ -1,4 +1,4 @@ -#!/bin/sh +#!/usr/bin/env sh if make -j "$(nproc)" T=open_source DEBUG=1 >log.txt 2>&1; then echo "build success" diff --git a/clear.sh b/clear.sh index f51df0a..ca1c125 100755 --- a/clear.sh +++ b/clear.sh @@ -1,3 +1,3 @@ -#!/bin/sh +#!/usr/bin/env sh make -j "$(nproc)" T=open_source DEBUG=1 clean diff --git a/convert.sh b/convert.sh index e6be442..05713ef 100755 --- a/convert.sh +++ b/convert.sh @@ -1,4 +1,4 @@ -#!/bin/sh +#!/usr/bin/env sh txt_to_wav() { hash="$(md5sum "$1" | cut -d ' ' -f 1)" diff --git a/download.sh b/download.sh index 7519f42..166b831 100755 --- a/download.sh +++ b/download.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash num=$(find /dev -name 'ttyACM*' | sort | rev | cut -c 1) echo com is: "$num" diff --git a/start_dev.sh b/start_dev.sh index ef95947..b484d73 100755 --- a/start_dev.sh +++ b/start_dev.sh @@ -1,2 +1,2 @@ -#!/bin/sh +#!/usr/bin/env sh docker-compose run --rm builder diff --git a/uart_log.sh b/uart_log.sh index 93f16a0..4edec55 100755 --- a/uart_log.sh +++ b/uart_log.sh @@ -1,4 +1,4 @@ -#!/bin/sh +#!/usr/bin/env sh num=$(find /dev -name 'ttyUSB*' | rev | cut -c 1) echo "$num"