Files
skeleton-small_project/scripts/create_change_file.sh
Martin Fencl d9bee53a00 init
2022-07-13 18:43:52 +02:00

17 lines
364 B
Bash
Executable File

#!/bin/bash
BRANCH=`git rev-parse --abbrev-ref HEAD`
if [ "x${BRANCH}" != "x" ] && [ "${BRANCH}" != "HEAD" ]
then
FILE="incoming_changes/${BRANCH}.md"
if [ -e $FILE ]
then
echo "file '${FILE}' already exists"
else
touch "${FILE}"
echo "file '${FILE}' created"
fi
else
echo "branch name '${BRANCH}' is not valid"
fi