Skip to content

Commit

Permalink
Make scripts/generate.sh POSIX compliant (#161)
Browse files Browse the repository at this point in the history
The script uses `/bin/sh` as the shell, but uses syntax that is
only defined for bash etc. These suggestions were made by
[`shellcheck`](https://www.shellcheck.net).
  • Loading branch information
WillSewell authored Jan 13, 2021
1 parent f982796 commit 4e17f20
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions scripts/generate.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/sh

PREFERRED_VERSION="$(< ./nix/preferred.txt)"
PREFERRED_VERSION="$(cat ./nix/preferred.txt)"

if [ -n "$1" ]; then
VERSION="$1"
Expand All @@ -23,7 +23,7 @@ if DIR=$(nix-build release.nix --attr "\"${VERSION}\"" --no-out-link); then
chmod -R u+w "${BASE}/schemas"
cp "${DIR}/types.dhall" "${DIR}/typesUnion.dhall" "${DIR}/defaults.dhall" "${DIR}/schemas.dhall" "${DIR}/package.dhall" "${BASE}"
chmod u+w "${BASE}/types.dhall" "${BASE}/typesUnion.dhall" "${BASE}/defaults.dhall" "${BASE}/schemas.dhall" "${BASE}/package.dhall"
if [ "${VERSION}" == "${PREFERRED_VERSION}" ]; then
if [ "${VERSION}" = "${PREFERRED_VERSION}" ]; then
cp -r "${DIR}/examples" "${BASE}"
chmod -R u+w "${BASE}/examples"
cp "${DIR}/Prelude.dhall" "${DIR}/README.md" "${BASE}"
Expand Down

0 comments on commit 4e17f20

Please sign in to comment.