From 5a6b37f3cc01b6c8eaf2113d36d2932fe455102c Mon Sep 17 00:00:00 2001 From: ash Date: Wed, 17 Aug 2022 23:03:21 +0100 Subject: [PATCH] Use /usr/bin/env as shebang everywhere It's not guaranteed that bash will be available at /bin/bash; it's even less likely that node will always be installed at /usr/bin/node{,js}. Always indirecting through /usr/bin/env means that there is only one such path that needs to be available. --- bin/apploader.js | 2 +- bin/create_app_supports_field.js | 2 +- bin/create_apps_json.sh | 2 +- bin/firmwaremaker.js | 2 +- bin/firmwaremaker_c.js | 2 +- bin/pre-publish.sh | 2 +- bin/sanitycheck.js | 2 +- bin/thumbnailer.js | 2 +- tests/Layout/bin/runalltests.sh | 2 +- tests/Layout/bin/runtest.sh | 2 +- 10 files changed, 10 insertions(+), 10 deletions(-) diff --git a/bin/apploader.js b/bin/apploader.js index 427a0ef99..76d518a27 100755 --- a/bin/apploader.js +++ b/bin/apploader.js @@ -1,4 +1,4 @@ -#!/usr/bin/nodejs +#!/usr/bin/env nodejs /* Simple Command-line app loader for Node.js =============================================== diff --git a/bin/create_app_supports_field.js b/bin/create_app_supports_field.js index d6aada357..24d6694f2 100644 --- a/bin/create_app_supports_field.js +++ b/bin/create_app_supports_field.js @@ -1,4 +1,4 @@ -#!/usr/bin/nodejs +#!/usr/bin/env nodejs /* Quick hack to add proper 'supports' field to apps.json */ diff --git a/bin/create_apps_json.sh b/bin/create_apps_json.sh index 30c58bc93..c9f310e57 100755 --- a/bin/create_apps_json.sh +++ b/bin/create_apps_json.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # ================================================================ # apps.json used to contain the metadata for every app. Now the # metadata is stored in each apps's directory - app/yourapp/metadata.js diff --git a/bin/firmwaremaker.js b/bin/firmwaremaker.js index 1c2d9cb77..1dc5ec073 100755 --- a/bin/firmwaremaker.js +++ b/bin/firmwaremaker.js @@ -1,4 +1,4 @@ -#!/usr/bin/nodejs +#!/usr/bin/env nodejs /* Mashes together a bunch of different apps to make a single firmware JS file which can be uploaded. diff --git a/bin/firmwaremaker_c.js b/bin/firmwaremaker_c.js index 4aa8e087f..87065dab4 100755 --- a/bin/firmwaremaker_c.js +++ b/bin/firmwaremaker_c.js @@ -1,4 +1,4 @@ -#!/usr/bin/node +#!/usr/bin/env node /* Mashes together a bunch of different apps into a big binary blob. We then store this *inside* the Bangle.js firmware and can use it diff --git a/bin/pre-publish.sh b/bin/pre-publish.sh index ee73968d7..710160ded 100755 --- a/bin/pre-publish.sh +++ b/bin/pre-publish.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash cd `dirname $0`/.. nodejs bin/sanitycheck.js || exit 1 diff --git a/bin/sanitycheck.js b/bin/sanitycheck.js index 9939b061b..cf66a52eb 100755 --- a/bin/sanitycheck.js +++ b/bin/sanitycheck.js @@ -1,4 +1,4 @@ -#!/usr/bin/node +#!/usr/bin/env node /* Checks for any obvious problems in apps.json */ diff --git a/bin/thumbnailer.js b/bin/thumbnailer.js index 278def4e4..0895098e9 100755 --- a/bin/thumbnailer.js +++ b/bin/thumbnailer.js @@ -1,4 +1,4 @@ -#!/usr/bin/node +#!/usr/bin/env node /* var EMULATOR = "banglejs2"; diff --git a/tests/Layout/bin/runalltests.sh b/tests/Layout/bin/runalltests.sh index 3a7aac50b..2d2985a4f 100755 --- a/tests/Layout/bin/runalltests.sh +++ b/tests/Layout/bin/runalltests.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash cd `dirname $0`/.. ls tests/*.js | xargs -I{} bin/runtest.sh {} diff --git a/tests/Layout/bin/runtest.sh b/tests/Layout/bin/runtest.sh index 9bac72283..f6c566d18 100755 --- a/tests/Layout/bin/runtest.sh +++ b/tests/Layout/bin/runtest.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # Requires Linux x64 (for ./espruino) # Also imagemagick for display