From 5a5319d32b6d9030c044af0dda06f0cd0e9fac26 Mon Sep 17 00:00:00 2001 From: Kegan Maher Date: Tue, 10 Sep 2024 22:51:17 +0000 Subject: [PATCH 1/2] feat: helper script for creating new user enforces username, firstname, and lastname to help me remember what I should be passing each time --- bin/new-user.sh | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100755 bin/new-user.sh diff --git a/bin/new-user.sh b/bin/new-user.sh new file mode 100755 index 0000000..c05b8b5 --- /dev/null +++ b/bin/new-user.sh @@ -0,0 +1,21 @@ +#!/usr/bin/env bash +set -e + +if [ $# -lt 3 ]; then + echo "Usage: $0 []" + exit 1 +fi + +USERNAME=$1 +FIRST=$2 +LAST=$3 +NOTIFY=${4:-} + +CMD="user create" +OPTS="$USERNAME firstname $FIRST lastname $LAST" + +if [[ "$NOTIFY" ]]; then + OPTS="--notify $NOTIFY $OPTS" +fi + +exec compiler-admin $CMD $OPTS From 500662f8ba9f645546a4e27cca2e03d33c3be3d0 Mon Sep 17 00:00:00 2001 From: Kegan Maher Date: Tue, 10 Sep 2024 23:45:42 +0000 Subject: [PATCH 2/2] feat: helper script for monthly hours convert reminds me to check the project mapping --- bin/hours-convert.sh | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100755 bin/hours-convert.sh diff --git a/bin/hours-convert.sh b/bin/hours-convert.sh new file mode 100755 index 0000000..ee59fe6 --- /dev/null +++ b/bin/hours-convert.sh @@ -0,0 +1,14 @@ +#!/usr/bin/env bash +set -e + +read -p "Did you remember to check the project mapping? $TOGGL_PROJECT_INFO (Y/n): " check_project + +if [[ "$check_project" ~= ^[^Yy]$ ]]; then + echo "Check and then run this script again" + exit 1 +fi + +CMD="time convert" +OPTS="--input $TOGGL_DATA --output $HARVEST_DATA" + +exec compiler-admin $CMD $OPTS