From 377c4b0eb54a750b0ce5a21955941ede6d608e29 Mon Sep 17 00:00:00 2001 From: Liam Waldron Date: Wed, 7 Jun 2023 11:16:58 -0400 Subject: [PATCH] epush --- tools/bldr/build.sh | 20 ++++++++++++++++++++ tools/epush | 28 ++++++++++++++++++++++++++++ 2 files changed, 48 insertions(+) create mode 100644 tools/bldr/build.sh create mode 100755 tools/epush diff --git a/tools/bldr/build.sh b/tools/bldr/build.sh new file mode 100644 index 0000000..bcc1c30 --- /dev/null +++ b/tools/bldr/build.sh @@ -0,0 +1,20 @@ +#!/bin/sh + +if [ $(/usr/bin/id -u) != 0 ]; then + printf "${0} must be run as root\n" + exit 1 +fi + +WORKING_DIR=$(pwd) + +printf "parsing install.conf\n" + if [ -f "${WORKING_DIR}/install.conf" ]; then + source ${WORKING_DIR}/install.conf + else + printf "${WORKING_DIR}/install.conf does not exist\n" + exit 1 + fi + +case ${1} in + install) + printf "installing...\n" diff --git a/tools/epush b/tools/epush new file mode 100755 index 0000000..5479266 --- /dev/null +++ b/tools/epush @@ -0,0 +1,28 @@ +#!/bin/sh +# Simple wrapper script around git to easily push an update + +COMMIT_MSG=${1} +BRANCH=$(git rev-parse --abbrev-ref HEAD) +FILES=("${@}") + +printf "Checking if Git repository is present...\n" + +git rev-parse --is-inside-work-tree +if [ "$?" != 0 ]; then + printf "Not a Git repository.\n" + exit 1 +fi + +if [ "${FILES}" = "" ]; then + printf "No files added.\n" + exit 1 +fi + +if [ "${COMMIT_MSG}" = "" ]; then + printf "No commit message.\n" + exit 1 +fi + +git add ${FILES} +git commit -m ${1} +git push origin ${BRANCH}