Skip to content

Commit e3148e0

Browse files
authored
Merge pull request skonfig#152 from skonfig/4nd3r/__file/test-e
__file: allow source to be character special (test -c)
2 parents d41195f + 3f9b3bb commit e3148e0

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

type/__file/gencode-local

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,12 +43,13 @@ then
4343
source="${__object:?}/stdin" ;;
4444
esac
4545

46-
test -f "${source}" || {
46+
if test ! -f "${source}" && test ! -c "${source}"
47+
then
4748
printf 'Source %s does not exist.\n' "${source}" >&2
4849
# NOTE: ignore for dry runs, because the file could be generated by
4950
# skonfig (e.g. __staged_file).
5051
test -n "${__cdist_dry_run+y}" || exit 1
51-
}
52+
fi
5253
fi
5354

5455

0 commit comments

Comments
 (0)