multi-account-containers/bin/build-addon.sh
Aryeh Hillman 4a9bc37a46 Use /usr/bin/env to find bash
This enables `npm test` to successfully call scripts in `bin/` with
the `bash` binary specified by `PROFILE`.

---

Additional information:

In addition to potentially preferring an alternative version of bash
than the one in `/bin/bash`, some distributions forego storing bash in
`bin/` at all, such as `NixOS`:

```bash
$ cat /etc/os-release | rg '^NAME=' -r ''
NixOS
$ which bash
/run/current-system/sw/bin/bash
```
2023-11-17 15:55:12 -08:00

26 lines
650 B
Bash
Executable file

#!/bin/env bash
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
. $(dirname $0)/commons.sh
print Y "Update the submodules..."
git submodule init || die
git submodule update --remote --depth 1 src/_locales || die
print Y "Installing dependencies..."
npm install --legacy-peer-deps || die
print Y "Running tests..."
npm test
print Y "Creating the final package..."
cd src || die
if [[ $# -gt 0 ]]; then
EXTRA_PARAMS="--filename $1"
fi
npx web-ext build --overwrite-dest $EXTRA_PARAMS || die