fix(args): handle quotes in passed args (#3)

* add ' to test

* separate git cliff args before passing

* file expansion
This commit is contained in:
Matteo Ferrando
2022-11-19 15:20:33 -04:00
committed by GitHub
parent ec7be25db9
commit 4d60dd0dbe
2 changed files with 8 additions and 2 deletions

View File

@@ -1,13 +1,19 @@
#!/bin/bash -l
set -uxo pipefail
# Avoid file expansion when passing parameters like with '*'
set -o noglob
OUTPUT=${OUTPUT:="git-cliff/CHANGELOG.md"}
# Create the output directory
mkdir -p "$(dirname $OUTPUT)"
# Separate arguments before passing them to git-cliff command
args=$(echo "$@" | xargs)
# Execute git-cliff
GIT_CLIFF_OUTPUT="$OUTPUT" git-cliff $@
GIT_CLIFF_OUTPUT="$OUTPUT" git-cliff $args
exit_code=$?
# Output to console