diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..1e34466 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,12 @@ +root = true + +[*] +charset = utf-8 +end_of_line = lf +insert_final_newline = true +trim_trailing_whitespace = true + +[[shell]] +indent_style = space +indent_size = 4 +switch_case_indent = true diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..e7e80ca --- /dev/null +++ b/Makefile @@ -0,0 +1,26 @@ +SHELL=/bin/bash +.DEFAULT_GOAL := help + +SHELL_SOURCES = bin/dev* + + +# ------------------------------- +# Common targets for Dev projects +# ------------------------------- +# +# Edit these targets so they work as expected on the current project. +# +# Remember there may be other tools which use these targets, so if a target is not suitable for +# the current project, then keep the target and simply make it do nothing. + +help: ## This help dialog. +help: + @awk '/^[\-[:alnum:]]*: ##/ { split($$0, x, "##"); printf "%20s%s\n", x[1], x[2]; }' $(MAKEFILE_LIST) + +install-local: ## Install the tools needed to work on this project. +install-local: + brew install shfmt + +format: ## Run this project's code formatters. +format: + shfmt --write $(SHELL_SOURCES) diff --git a/bin/dev-clone b/bin/dev-clone index ef76701..89435b8 100755 --- a/bin/dev-clone +++ b/bin/dev-clone @@ -42,8 +42,7 @@ git clone "$GIT_URI" . # mkproject fails with super strict mode - so we need to allow unbound variables at this point set +u -if grep --fixed-strings --silent "basepython" tox.ini; -then +if grep --fixed-strings --silent "basepython" tox.ini; then PYTHON_VERSION=$(sed -e 's/basepython[[:space:]]=[[:space:]]//' -e 'tx' -e 'd' -e ':x' tox.ini | head -n 1) PYTHON_VERSION_NUMBER=${PYTHON_VERSION/python/} LATEST_PYTHON=$(pyenv latest "$PYTHON_VERSION_NUMBER") diff --git a/bin/dev-unlock-server b/bin/dev-unlock-server index 4be6326..3296680 100755 --- a/bin/dev-unlock-server +++ b/bin/dev-unlock-server @@ -9,7 +9,7 @@ fi HOST="$1" LUKS_PASSPHRASE=$(op read "op://aizi3l3vxjc52mboshwj7bbytq/$HOST/password") -echo -n "$LUKS_PASSPHRASE" | \ +echo -n "$LUKS_PASSPHRASE" | ssh -o UserKnownHostsFile="$HOME/.ssh/known_hosts.cryptroot-unlock" \ -o StrictHostKeyChecking=accept-new \ -o BatchMode=yes \ diff --git a/bin/dev-update-aws-config b/bin/dev-update-aws-config index bd29fcb..a42cfed 100755 --- a/bin/dev-update-aws-config +++ b/bin/dev-update-aws-config @@ -17,6 +17,6 @@ if [ -f ~/.aws/config ]; then mv ~/.aws/config "$HOME/.aws/config.old.$OLD_TIMESTAMP" fi -op read "op://Shared/AWS Config Template/notesPlain" | sed -e "s|USERNAME|$CONFIG_USERNAME|g" > ~/.aws/config +op read "op://Shared/AWS Config Template/notesPlain" | sed -e "s|USERNAME|$CONFIG_USERNAME|g" >~/.aws/config echo "Config file updated!"