X-Git-Url: https://git.madduck.net/etc/vim.git/blobdiff_plain/3d0689470752daedf7ef2bc9e602478ea31c0430..e4b4fb02b91e0f5a60a9678604653aecedff513b:/action/entrypoint.sh diff --git a/action/entrypoint.sh b/action/entrypoint.sh index 50f9472..30bf4eb 100755 --- a/action/entrypoint.sh +++ b/action/entrypoint.sh @@ -1,17 +1,9 @@ -#!/bin/bash -set -e +#!/bin/bash -e -# If no arguments are given use current working directory -black_args=(".") -if [ "$#" -eq 0 ] && [ "${INPUT_BLACK_ARGS}" != "" ]; then - black_args+=(${INPUT_BLACK_ARGS}) -elif [ "$#" -ne 0 ] && [ "${INPUT_BLACK_ARGS}" != "" ]; then - black_args+=($* ${INPUT_BLACK_ARGS}) -elif [ "$#" -ne 0 ] && [ "${INPUT_BLACK_ARGS}" == "" ]; then - black_args+=($*) -else - # Default (if no args provided). - black_args+=("--check" "--diff") +if [ -n "$INPUT_BLACK_ARGS" ]; then + echo '::warning::Input `with.black_args` is deprecated. Use `with.options` and `with.src` instead.' + black $INPUT_BLACK_ARGS + exit $? fi -sh -c "black . ${black_args[*]}" +black $INPUT_OPTIONS $INPUT_SRC