aboutsummarylogtreecommitdiffstats
path: root/clickup-wrapper
blob: 10d93caef4a0702bf57a2c926622817cd71525f3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#!/bin/bash

CLICKUP_DIR="/opt/clickup"

find_latest_appimage() {
  find "$CLICKUP_DIR" -name "*.AppImage" -type f -printf '%T@ %p\n' \
    | sort -nr \
    | head -n1 \
    | cut -d' ' -f2-
}

CLICKUP_APPIMAGE=$(find_latest_appimage)

if [ ! -s "$CLICKUP_APPIMAGE" ]; then
  echo "Error: No ClickUp AppImage file found in $CLICKUP_DIR"
  exit 1
fi 

if [ ! -x "$CLICKUP_APPIMAGE" ]; then
    echo "Adding execution permissions to $CLICKUP_APPIMAGE"
    chmod +x "$CLICKUP_APPIMAGE"
fi 

exec "$CLICKUP_APPIMAGE" "$@"