multi-account-containers/bin/addons-linter.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

35 lines
931 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/.
# addons-linter is not happy to see a `.github` folder in src/_locales.
# We need to do an horrible hack to run the test.
. $(dirname $0)/commons.sh
TMPDIR=/tmp/MAC_addonsLinter
print Y "Update the submodules..."
git submodule init || die
git submodule update --remote --depth 1 src/_locales || die
printn Y "Removing previous execution data... "
rm -rf $TMPDIR || die
print G "done."
printn Y "Creating a tmp folder ($TMPDIR)... "
mkdir $TMPDIR || die
print G "done."
printn Y "Copying data... "
cp -r src $TMPDIR || die
print G "done."
printn Y "Removing the github folder... "
rm -rf $TMPDIR/src/_locales/.github || die
print G "done."
print Y "Running the test..."
npx addons-linter $TMPDIR/src || die