Skip to content

Commit

Permalink
fix color output
Browse files Browse the repository at this point in the history
  • Loading branch information
radhermit committed Nov 13, 2024
1 parent 075732e commit 6feddec
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions pkgcruft-action
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,11 @@ set +e
SCAN_DIR="${HOME}/.cache/pkgcruft/scans/${GIT_BRANCH}"
mkdir -p "${SCAN_DIR}"
pkgcruft scan "${REPO}" -R json > "${SCAN_DIR}/new.json"
# enable color output
export CLICOLOR=1
pkgcruft replay --sort "${SCAN_DIR}/new.json"
CLICOLOR_FORCE=1 pkgcruft replay --sort "${SCAN_DIR}/new.json"

if [[ -f ${SCAN_DIR}/old.json ]]; then
diff=$(mktemp)
pkgcruft diff --sort "${SCAN_DIR}/old.json" "${SCAN_DIR}/new.json" > "${diff}"
CLICOLOR_FORCE=1 pkgcruft diff --sort "${SCAN_DIR}/old.json" "${SCAN_DIR}/new.json" > "${diff}"
# output diff if changes exists
if [[ -s ${diff} ]]; then
echo -e "\n\nDifferences from last run"
Expand Down Expand Up @@ -76,7 +74,7 @@ set +e
OLD_SCAN_DIR="${HOME}/.cache/pkgcruft/scans/${GIT_DEFAULT_BRANCH}"
if [[ -f ${OLD_SCAN_DIR}/old.json ]]; then
diff=$(mktemp)
pkgcruft diff --sort "${OLD_SCAN_DIR}/old.json" "${SCAN_DIR}/new.json" > "${diff}"
CLICOLOR_FORCE=1 pkgcruft diff --sort "${OLD_SCAN_DIR}/old.json" "${SCAN_DIR}/new.json" > "${diff}"
# output diff if changes exists
if [[ -s ${diff} ]]; then
echo -e "\n\nDifferences from default branch: ${GIT_DEFAULT_BRANCH}"
Expand Down

0 comments on commit 6feddec

Please sign in to comment.