This repository was archived by the owner on Dec 3, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 4 files changed +253
-90
lines changed Expand file tree Collapse file tree 4 files changed +253
-90
lines changed Original file line number Diff line number Diff line change @@ -29,7 +29,7 @@ The source code is available at [Github][gh]. Pull requests are welcome.
29
29
Clone this repository.
30
30
Copy the ` info.plist.template ` file to ` info.plist ` .
31
31
32
- The update the variables ` hakuna_api_key ` and ` hakuna_base_url ` to match your Hakuna instance.
32
+ Then update the variables ` hakuna_api_key ` and ` hakuna_base_url ` to match your Hakuna instance.
33
33
34
34
** Before you push, make sure to copy ` info.plist ` to ` info.plist.template ` and remove all sensitive information!**
35
35
Original file line number Diff line number Diff line change @@ -19,6 +19,7 @@ project_id=${hakuna_project_id-$1}
19
19
task_id=${hakuna_task_id-$2 }
20
20
if ! start_time=$( format_time " ${start_time-$3 } " ) ; then
21
21
echo " The given time '$start_time ' is not valid. The expected format is 'hh:mm' or 'hh:mm:ss'."
22
+ exit 1
22
23
fi
23
24
note=${hakuna_note-${4-} }
24
25
Original file line number Diff line number Diff line change 2
2
3
3
. utils.sh
4
4
5
- load timer PUT
5
+ format_time () {
6
+ if expr " $1 " : ' ^[0-2][0-9]:[0-5][0-9]:[0-5][0-9]$' > /dev/null; then
7
+ echo " ${1%:* } "
8
+ return 0
9
+ elif ! expr " $end_time " : ' ^[0-2][0-9]:[0-5][0-9]$' > /dev/null; then
10
+ echo " $1 "
11
+ return 1
12
+ else
13
+ echo " $1 "
14
+ return 0
15
+ fi
16
+ }
17
+
18
+ if ! end_time=$( format_time " ${end_time-$1 } " ) ; then
19
+ echo " The given time '$end_time ' is not valid. The expected format is 'hh:mm' or 'hh:mm:ss'."
20
+ exit 1
21
+ fi
22
+
23
+ echo \
24
+ " {
25
+ \" end_time\" : \" $end_time \"
26
+ }" \
27
+ | load timer PUT @-
6
28
7
29
if filter .error > /dev/null; then
8
30
echo " Currently there is no running timer to stop."
You can’t perform that action at this time.
0 commit comments