X-Git-Url: https://git.madduck.net/etc/vim.git/blobdiff_plain/3d0689470752daedf7ef2bc9e602478ea31c0430..3bba8081735925ccd95d8e0ccd26c92e08e0b7a9:/action/entrypoint.sh?ds=sidebyside 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