From 46557cddd13e4da94bc7b0ab142b6bc445e75385 Mon Sep 17 00:00:00 2001 From: Muhammed Hussain Karimi Date: Thu, 18 Dec 2025 15:43:24 +0330 Subject: [PATCH] :technologist: Improve shebang compatibility (#1180) Signed-off-by: Muhammed Hussain Karimi --- .envrc | 1 + .gitignore | 1 + build-rustfs.sh | 2 +- crates/ecstore/run_benchmarks.sh | 2 +- docker-buildx.sh | 2 +- docs/console-separation.md | 2 +- docs/examples/docker/docker-quickstart.sh | 2 +- docs/examples/docker/enhanced-docker-deployment.sh | 2 +- docs/examples/docker/enhanced-security-deployment.sh | 2 +- docs/examples/mnmd/test-deployment.sh | 2 +- scripts/dev_deploy.sh | 2 +- scripts/dev_rustfs.sh | 2 +- scripts/e2e-run.sh | 3 ++- scripts/install-flatc.sh | 2 +- scripts/install-protoc.sh | 2 +- scripts/notify.sh | 3 ++- scripts/run.sh | 4 +++- scripts/run_e2e_tests.sh | 2 +- scripts/run_scanner_benchmarks.sh | 2 +- scripts/setup-test-binaries.sh | 2 +- scripts/test.sh | 2 +- scripts/test/delete_xldir.sh | 2 +- scripts/test/delete_xldir_simple.sh | 2 +- 23 files changed, 27 insertions(+), 21 deletions(-) create mode 100644 .envrc diff --git a/.envrc b/.envrc new file mode 100644 index 00000000..8392d159 --- /dev/null +++ b/.envrc @@ -0,0 +1 @@ +use flake \ No newline at end of file diff --git a/.gitignore b/.gitignore index f4be8260..c5218d5f 100644 --- a/.gitignore +++ b/.gitignore @@ -2,6 +2,7 @@ .DS_Store .idea .vscode +.direnv/ /test /logs /data diff --git a/build-rustfs.sh b/build-rustfs.sh index 651ef735..51e2383c 100755 --- a/build-rustfs.sh +++ b/build-rustfs.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # RustFS Binary Build Script # This script compiles RustFS binaries for different platforms and architectures diff --git a/crates/ecstore/run_benchmarks.sh b/crates/ecstore/run_benchmarks.sh index cf6988e0..7e5266c3 100755 --- a/crates/ecstore/run_benchmarks.sh +++ b/crates/ecstore/run_benchmarks.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # Copyright 2024 RustFS Team # # Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/docker-buildx.sh b/docker-buildx.sh index d5770078..ed19c077 100755 --- a/docker-buildx.sh +++ b/docker-buildx.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash set -e diff --git a/docs/console-separation.md b/docs/console-separation.md index 8b6b3861..7795b4fd 100644 --- a/docs/console-separation.md +++ b/docs/console-separation.md @@ -1068,7 +1068,7 @@ curl http://localhost:9001/health #### Docker Migration Example ```bash -#!/bin/bash +#!/usr/bin/env bash # migrate-docker.sh # Stop old container diff --git a/docs/examples/docker/docker-quickstart.sh b/docs/examples/docker/docker-quickstart.sh index 03ceb78a..a83da686 100755 --- a/docs/examples/docker/docker-quickstart.sh +++ b/docs/examples/docker/docker-quickstart.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # RustFS Docker Quick Start Script # This script provides easy deployment commands for different scenarios diff --git a/docs/examples/docker/enhanced-docker-deployment.sh b/docs/examples/docker/enhanced-docker-deployment.sh index 0baefda4..aa6f5ee8 100755 --- a/docs/examples/docker/enhanced-docker-deployment.sh +++ b/docs/examples/docker/enhanced-docker-deployment.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # RustFS Enhanced Docker Deployment Examples # This script demonstrates various deployment scenarios for RustFS with console separation diff --git a/docs/examples/docker/enhanced-security-deployment.sh b/docs/examples/docker/enhanced-security-deployment.sh index d5c2aa33..63c401ae 100755 --- a/docs/examples/docker/enhanced-security-deployment.sh +++ b/docs/examples/docker/enhanced-security-deployment.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # RustFS Enhanced Security Deployment Script # This script demonstrates production-ready deployment with enhanced security features diff --git a/docs/examples/mnmd/test-deployment.sh b/docs/examples/mnmd/test-deployment.sh index 89c3b9e3..5433632a 100755 --- a/docs/examples/mnmd/test-deployment.sh +++ b/docs/examples/mnmd/test-deployment.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # Copyright 2024 RustFS Team # # Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/scripts/dev_deploy.sh b/scripts/dev_deploy.sh index 23da85a0..c73b9ce1 100755 --- a/scripts/dev_deploy.sh +++ b/scripts/dev_deploy.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # Copyright 2024 RustFS Team # # Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/scripts/dev_rustfs.sh b/scripts/dev_rustfs.sh index 11ce4389..7a69e1e2 100644 --- a/scripts/dev_rustfs.sh +++ b/scripts/dev_rustfs.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # Copyright 2024 RustFS Team # # Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/scripts/e2e-run.sh b/scripts/e2e-run.sh index 9127fd0c..b518c598 100755 --- a/scripts/e2e-run.sh +++ b/scripts/e2e-run.sh @@ -1,4 +1,5 @@ -#!/bin/bash -ex +#!/usr/bin/env bash +set -ex # Copyright 2024 RustFS Team # # Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/scripts/install-flatc.sh b/scripts/install-flatc.sh index 1f95a9cc..b787b8a4 100755 --- a/scripts/install-flatc.sh +++ b/scripts/install-flatc.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # Install flatc 25.9.23 on macOS set -e diff --git a/scripts/install-protoc.sh b/scripts/install-protoc.sh index dfb52a0a..3d85cf21 100755 --- a/scripts/install-protoc.sh +++ b/scripts/install-protoc.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # Install protoc 33.1 on macOS set -e diff --git a/scripts/notify.sh b/scripts/notify.sh index 49aedaf7..1acbcea2 100755 --- a/scripts/notify.sh +++ b/scripts/notify.sh @@ -1,4 +1,5 @@ -#!/bin/bash -e +#!/usr/bin/env bash +set -e # Copyright 2024 RustFS Team # # Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/scripts/run.sh b/scripts/run.sh index 0dc3a32a..d3e99945 100755 --- a/scripts/run.sh +++ b/scripts/run.sh @@ -1,4 +1,6 @@ -#!/bin/bash -e +#!/usr/bin/env bash +set -e + # Copyright 2024 RustFS Team # # Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/scripts/run_e2e_tests.sh b/scripts/run_e2e_tests.sh index c9e0894d..754782f1 100755 --- a/scripts/run_e2e_tests.sh +++ b/scripts/run_e2e_tests.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # E2E Test Runner Script # Automatically starts RustFS instance, runs tests, and cleans up diff --git a/scripts/run_scanner_benchmarks.sh b/scripts/run_scanner_benchmarks.sh index bbf68530..dce92f2b 100755 --- a/scripts/run_scanner_benchmarks.sh +++ b/scripts/run_scanner_benchmarks.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # Scanner performance benchmark runner # Usage: ./scripts/run_scanner_benchmarks.sh [test_type] [quick] diff --git a/scripts/setup-test-binaries.sh b/scripts/setup-test-binaries.sh index f3f01662..fa2389b0 100755 --- a/scripts/setup-test-binaries.sh +++ b/scripts/setup-test-binaries.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # Setup test binaries for Docker build testing # This script creates temporary binary files for testing Docker build process diff --git a/scripts/test.sh b/scripts/test.sh index b4e1c68a..cca9e750 100755 --- a/scripts/test.sh +++ b/scripts/test.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # Copyright 2024 RustFS Team # # Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/scripts/test/delete_xldir.sh b/scripts/test/delete_xldir.sh index 8b6896cd..ad422668 100755 --- a/scripts/test/delete_xldir.sh +++ b/scripts/test/delete_xldir.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # Delete all directories ending with __XLDIR__ in the specified path diff --git a/scripts/test/delete_xldir_simple.sh b/scripts/test/delete_xldir_simple.sh index 04d4406e..493e88e6 100755 --- a/scripts/test/delete_xldir_simple.sh +++ b/scripts/test/delete_xldir_simple.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # Simple version: Delete all directories ending with __XLDIR__ in the specified path