diff --git a/_do_build_scanner b/_do_build_scanner index ead05a5..33f7d22 100755 --- a/_do_build_scanner +++ b/_do_build_scanner @@ -1,4 +1,5 @@ #!/bin/sh +# using sh, is run from alpine . ./_build_vars go build \ diff --git a/_do_build_server b/_do_build_server index 9929116..26d1697 100755 --- a/_do_build_server +++ b/_do_build_server @@ -1,4 +1,5 @@ #!/bin/sh +# using sh, is run from alpine . ./_build_vars ./_do_gen_assets diff --git a/_do_bump_version b/_do_bump_version index 8fce628..074fa39 100755 --- a/_do_bump_version +++ b/_do_bump_version @@ -1,16 +1,19 @@ -#!/bin/sh +#!/usr/bin/env bash # safety checks if [[ $# -ne 1 ]]; then echo "usage: $0 " >&2 exit 1 fi -if [[ -n "$(git status --porcelain)" ]]; then - echo "working directory is dirty" >&2 +if [[ "$(git rev-parse --abbrev-ref HEAD)" != 'master' ]]; then + echo "not on the master branch" >&2 exit 1 fi -if [[ "$(git branch --show-current)" != 'master' ]]; then - echo "not on the master branch" >&2 + +# get latest and check if clean +git pull +if [[ -n "$(git status --porcelain)" ]]; then + echo "working directory is dirty" >&2 exit 1 fi diff --git a/_do_gen_assets b/_do_gen_assets index d7e6e28..9b873a1 100755 --- a/_do_gen_assets +++ b/_do_gen_assets @@ -1,10 +1,11 @@ #!/bin/sh +# using sh, is run from alpine embed_bin_path=/tmp/gonicembed assets_path=server/assets # only build once for some slightly faster live page reloading -if ! test -e "$embed_bin_path"; then +if [[ ! -e "$embed_bin_path" ]]; then go build \ -o "$embed_bin_path" \ cmd/gonicembed/main.go diff --git a/_do_gen_handler_tests b/_do_gen_handler_tests index 7ceb14b..cc96898 100755 --- a/_do_gen_handler_tests +++ b/_do_gen_handler_tests @@ -1,11 +1,11 @@ -#!/bin/sh +#!/usr/bin/env bash test_data_path=server/ctrlsubsonic/testdata test_listen_addr=localhost:9353 test_music_path=~/music test_db_path=$test_data_path/db -if test "$1" == "--scan"; then +if [[ "$1" == "--scan" ]]; then echo -e "\e[91mwarning: \e[39mthe --scan option was passed" echo "- this option should only be used if the database schema changes" echo "- the test json will likely change a lot" diff --git a/_do_run_scanner b/_do_run_scanner index 55c4392..2cd0218 100755 --- a/_do_run_scanner +++ b/_do_run_scanner @@ -1,4 +1,4 @@ -#!/bin/sh +#!/usr/bin/env bash . ./_build_vars go run \ diff --git a/_do_run_server b/_do_run_server index 5e524eb..9d7df97 100755 --- a/_do_run_server +++ b/_do_run_server @@ -1,4 +1,4 @@ -#!/bin/sh +#!/usr/bin/env bash . ./_build_vars ./_do_gen_assets diff --git a/_do_run_server_live b/_do_run_server_live index f20320d..728b63c 100755 --- a/_do_run_server_live +++ b/_do_run_server_live @@ -1,4 +1,4 @@ -#!/bin/sh +#!/usr/bin/env bash if ! command -v 'entr' > /dev/null; then echo 'please install `entr`' >&2