-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathutils.sh
More file actions
40 lines (34 loc) · 746 Bytes
/
utils.sh
File metadata and controls
40 lines (34 loc) · 746 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#!/bin/bash
# Colors
RED='\033[0;31m'
GREEN='\033[0;32m'
YELLOW='\033[1;33m'
NC='\033[0m' # No Color
# Logging functions
log_info() {
echo -e "${GREEN}[INFO]${NC} $1"
}
log_warn() {
echo -e "${YELLOW}[WARN]${NC} $1"
}
log_error() {
echo -e "${RED}[ERROR]${NC} $1"
}
# Check for required tools
check_deps() {
if ! command -v jq &> /dev/null; then
log_error "jq is required but not installed."
exit 1
fi
if ! command -v curl &> /dev/null; then
log_error "curl is required but not installed."
exit 1
fi
}
# Check if CURSOR_API_KEY is set
check_auth() {
if [ -z "$CURSOR_API_KEY" ]; then
log_error "CURSOR_API_KEY environment variable is not set."
exit 1
fi
}