X-Git-Url: https://git.madduck.net/etc/vim.git/blobdiff_plain/ba3648d98471a6d0ad951d7f75ac512108173bc7..53d9bace12b3aa230820c869a079020b4608c945:/action/entrypoint.sh?ds=sidebyside diff --git a/action/entrypoint.sh b/action/entrypoint.sh index 92501f7..30bf4eb 100755 --- a/action/entrypoint.sh +++ b/action/entrypoint.sh @@ -1,17 +1,9 @@ -#!/bin/sh -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