spiegel-keyman/resources/gosh
Marc Durdin 767927bf16 chore(common): use /usr/bin/env bash
Fixes up scripts (except under /linux) to use `#!/usr/bin/env bash`
instead of `#!/bin/bash` or `#!/bin/sh` so that we don't end up with
the ancient version of bash supplied with macOS.

This became urgent with this PR, because of bash-4.xisms in
build-utils.sh, for example on line 572:

```
if [[ -v _builder_params[$e] ]]; then
```
2022-07-25 14:59:37 +10:00
..
gosh.bat change(common/resources): move gosh scripts to resource/gosh 2020-05-25 08:29:15 -06:00
gosh.js chore(web): move common/core/web to common/web 2022-05-18 06:01:03 +10:00
gosh.sh chore(common): use /usr/bin/env bash 2022-07-25 14:59:37 +10:00
package.json chore(web): move version from package.json to keyman-version package 2022-04-17 06:47:39 +10:00
README.md docs(common/resources): spruce up gosh README 2020-05-25 08:27:25 -06:00

@keymanapp/resources-gosh

gosh is a simple platform-agnostic launcher for bash scripts. On Windows, it will locate an installation of Git for Windows and use bash from that script. On *nix, it uses the system-supplied version of bash.

TODO: it would be possible for gosh to grab a newer version of bash on macOS which could simplify some of our cross-platform scripts?

Usage

gosh can be run as an npm module command or from the command line with the gosh/gosh.bat pair. The first parameter should be the bash script to run, and all subsequent parameters passed to gosh will be passed to the script unmodified. Note that paths passed to gosh should always use forward slashes (/), irrespective of the platform.

Examples

package.json

Invoke bash scripts using gosh instead:

  "scripts": {
    "build": "gosh ./build.sh",
    "test": "gosh ./unit_tests/test.sh"
  },
  • TeamCity instantiation: (path = web/source) ../../resources/gosh/gosh ./build.sh -publish-sentry