Skip to content

Commit

Permalink
Revert "shellcheck fixes"
Browse files Browse the repository at this point in the history
This reverts commit 6f234e5.
  • Loading branch information
straight-shoota committed Oct 31, 2024
1 parent ac9d346 commit fc88d57
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 19 deletions.
30 changes: 15 additions & 15 deletions bin/ci
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
#!/bin/sh

fail() {
echo "${*}" >&2
echo "${@}" >&2
exit 1
}

on_tag() {
if [ -n "$CURRENT_TAG" ]; then
echo "${*}"
eval "${*}"
echo "${@}"
eval "${@}"
return $?
else
return 0
Expand All @@ -20,7 +20,7 @@ fail_on_error() {

exit=$?
if [ "$exit" -ne "0" ]; then
fail "${*} exited with $exit"
fail "${@} exited with $exit"
fi

return 0
Expand Down Expand Up @@ -50,8 +50,8 @@ on_os() {
verify_environment

if [ "$TRAVIS_OS_NAME" = "$os" ]; then
echo "${*}"
eval "${*}"
echo "${@}"
eval "${@}"
return $?
else
return 0
Expand All @@ -62,30 +62,30 @@ on_os() {
}

on_linux() {
fail_on_error on_os "linux" "${*}"
fail_on_error on_os "linux" "${@}"
}

on_osx() {
fail_on_error on_os "osx" "${*}"
fail_on_error on_os "osx" "${@}"
}

on_nix_shell_eval() {
if [ -n "$CI_NIX_SHELL" ]; then
echo "${*}"
eval "${*}"
echo "${@}"
eval "${@}"
return $?
else
return 0
fi
}

on_nix_shell() {
fail_on_error on_nix_shell_eval "${*}"
fail_on_error on_nix_shell_eval "${@}"
}

on_github() {
if [ "$GITHUB_ACTIONS" = "true" ]; then
eval "${*}"
eval "${@}"
return $?
else
return 0
Expand Down Expand Up @@ -153,7 +153,7 @@ prepare_build() {

# Install a recent bash version for nix-shell.
# macos ships with an ancient one.
if [ "$(uname)" = "Darwin" ]; then
if [ $(uname) = "Darwin" ]; then
on_nix_shell "brew install bash"
fi
# initialize nix environment
Expand Down Expand Up @@ -205,7 +205,7 @@ with_build_env() {

on_linux docker run \
--rm -t \
-u "$(id -u)" \
-u $(id -u) \
-v "$PWD":/mnt \
-v /etc/passwd:/etc/passwd \
-v /etc/group:/etc/group \
Expand Down Expand Up @@ -254,7 +254,7 @@ case $command in
prepare_build
;;
with_build_env)
target_command="${*}"
target_command="${@}"
with_build_env "$target_command"
;;
build)
Expand Down
2 changes: 1 addition & 1 deletion scripts/update-changelog.sh
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ git add shard.yml

# Write release date into src/SOURCE_DATE_EPOCH
release_date=$(head -n1 "$current_changelog" | grep -o -P '(?<=\()[^)]+')
date --utc --date="${release_date}" +%s > src/SOURCE_DATE_EPOCH
echo "$(date --utc --date="${release_date}" +%s)" > src/SOURCE_DATE_EPOCH
git add src/SOURCE_DATE_EPOCH

if grep --silent -E "^## \[$VERSION\]" CHANGELOG.md; then
Expand Down
4 changes: 2 additions & 2 deletions spec/generate_wasm32_spec.sh
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ echo

for spec in $(find "spec/std" -type f -iname "*_spec.cr" | LC_ALL=C sort); do
require="require \"./${spec##spec/}\""
target="$WORK_DIR/$spec.wasm"
mkdir -p "$(dirname "$target")"
target=$WORK_DIR"/"$spec".wasm"
mkdir -p $(dirname "$target")

if ! output=$(bin/crystal build "$spec" -o "$target" --target wasm32-wasi 2>&1); then
if [[ "$output" =~ "execution of command failed" ]]; then
Expand Down
2 changes: 1 addition & 1 deletion spec/llvm-ir/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ crystal=${CRYSTAL_SPEC_COMPILER_BIN:-$SCRIPT_ROOT/../../bin/crystal}
mkdir -p "$BUILD_DIR"

function test() {
echo "test: $*"
echo "test: $@"

input_cr="$SCRIPT_ROOT/$1"
output_ll="$BUILD_DIR/${1%.cr}.ll"
Expand Down

0 comments on commit fc88d57

Please sign in to comment.