Skip to content

Commit

Permalink
Make shell scripts POSIX-compliant (#879)
Browse files Browse the repository at this point in the history
Fixes #878
  • Loading branch information
j8r authored and edwardloveall committed Aug 25, 2019
1 parent 0356c38 commit 6f08454
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 19 deletions.
12 changes: 4 additions & 8 deletions script/precompile_tasks
Original file line number Diff line number Diff line change
@@ -1,13 +1,9 @@
#! /bin/bash

# Exit if any subcommand fails
set -e
set -o pipefail
#!/bin/sh -e

# Precompile tasks if not in production and not in CI
# Also allow skipping precompilation with an ENV var
if [ "$LUCKY_ENV" != "production" ] && [ -z "$CI" ] && [ -z "$SKIP_LUCKY_TASK_PRECOMPILATION" ]; then
shards build && \
mkdir -p ../../bin && \
cp -r $(pwd)/bin $(pwd)/../..
shards build
mkdir -p ../../bin
cp -r $PWD/bin $PWD/../..
fi
6 changes: 1 addition & 5 deletions script/setup
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
#! /bin/bash

# Exit if any subcommand fails
set -e
set -o pipefail
#!/bin/sh -eu

if ! command -v docker-compose > /dev/null; then
printf 'Docker and docker-compose are not installed.\n'
Expand Down
8 changes: 2 additions & 6 deletions script/test
Original file line number Diff line number Diff line change
@@ -1,16 +1,12 @@
#! /bin/bash
#!/bin/sh -eu

# Exit if any subcommand fails
set -e
set -o pipefail

COMPOSE="docker-compose run --rm app"

printf "\nrunning specs with 'crystal spec'\n\n"
$COMPOSE crystal spec "$@"

if [ $# -eq 0 ]
then
if [ $# = 0 ]; then
printf "\nChecking that tasks build correctly\n\n"
$COMPOSE shards build

Expand Down

0 comments on commit 6f08454

Please sign in to comment.