From bbb90bbfe350b919489b07245ab470ae00e9ac52 Mon Sep 17 00:00:00 2001 From: fiftydinar <65243233+fiftydinar@users.noreply.github.com> Date: Mon, 10 Mar 2025 10:57:29 +0100 Subject: [PATCH] fix(justfiles): Log message about grep not finding `60-custom.just` --- modules/justfiles/justfiles.sh | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/modules/justfiles/justfiles.sh b/modules/justfiles/justfiles.sh index e9e5c7d..82ce34a 100644 --- a/modules/justfiles/justfiles.sh +++ b/modules/justfiles/justfiles.sh @@ -71,13 +71,17 @@ for SELECTED in "${CONFIG_SELECTION[@]}"; do IMPORT_LINE="import \"${DEST_FOLDER}/${JUSTFILE}\"" # Skip the import line if it already exists, else append it to import file - if grep -wq "${IMPORT_LINE}" "${IMPORT_FILE}"; then - echo "- Skipped: '${IMPORT_LINE}' (already present)" - else - echo "${IMPORT_LINE}" >> "${IMPORT_FILE}" + if [[ -f "${IMPORT_FILE}" ]]; then + if grep -wq "${IMPORT_LINE}" "${IMPORT_FILE}"; then + echo "- Skipped: '${IMPORT_LINE}' (already present)" + else + echo "${IMPORT_LINE}" >> "${IMPORT_FILE}" + echo "- Added: '${IMPORT_LINE}'" + fi + else + echo "${IMPORT_LINE}" > "${IMPORT_FILE}" echo "- Added: '${IMPORT_LINE}'" - fi - + fi done done