Skip to content

Commit 985f55a

Browse files
authored
Feat: helper scripts (#24)
2 parents f12a594 + 500662f commit 985f55a

File tree

2 files changed

+35
-0
lines changed

2 files changed

+35
-0
lines changed

bin/hours-convert.sh

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#!/usr/bin/env bash
2+
set -e
3+
4+
read -p "Did you remember to check the project mapping? $TOGGL_PROJECT_INFO (Y/n): " check_project
5+
6+
if [[ "$check_project" ~= ^[^Yy]$ ]]; then
7+
echo "Check and then run this script again"
8+
exit 1
9+
fi
10+
11+
CMD="time convert"
12+
OPTS="--input $TOGGL_DATA --output $HARVEST_DATA"
13+
14+
exec compiler-admin $CMD $OPTS

bin/new-user.sh

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
#!/usr/bin/env bash
2+
set -e
3+
4+
if [ $# -lt 3 ]; then
5+
echo "Usage: $0 <username> <First> <Last> [<notify>]"
6+
exit 1
7+
fi
8+
9+
USERNAME=$1
10+
FIRST=$2
11+
LAST=$3
12+
NOTIFY=${4:-}
13+
14+
CMD="user create"
15+
OPTS="$USERNAME firstname $FIRST lastname $LAST"
16+
17+
if [[ "$NOTIFY" ]]; then
18+
OPTS="--notify $NOTIFY $OPTS"
19+
fi
20+
21+
exec compiler-admin $CMD $OPTS

0 commit comments

Comments
 (0)