Add shell linting and tidying and update all shell scripts

This commit is contained in:
Dave Rolsky
2024-05-18 12:09:08 +08:00
parent c464bd9469
commit 9b467e6799
9 changed files with 69 additions and 33 deletions

View File

@@ -1,20 +1,23 @@
#!/bin/bash
set -e
set -x
set -o pipefail
TARGET=$1
did_strip=""
strip_binary () {
if [[ $( uname -s ) =~ "Darwin" ]]; then
strip_binary() {
if [[ $(uname -s) =~ "Darwin" ]]; then
stripped=$(
find "$1" -maxdepth 1 -type f -perm +111 | while read exe; do
find "$1" -maxdepth 1 -type f -perm +111 | while read -r exe; do
strip "$exe"
echo "stripped $exe"
done
)
else
stripped=$(
find "$1" -maxdepth 1 -type f -executable | while read exe; do
find "$1" -maxdepth 1 -type f -executable | while read -r exe; do
strip "$exe"
echo "stripped $exe"
done