-
-
Notifications
You must be signed in to change notification settings - Fork 18
/
compile.sh
35 lines (26 loc) · 894 Bytes
/
compile.sh
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
#!/bin/bash
clear
# Function to log messages
log_message() {
echo "[`date +"%Y-%m-%d %H:%M:%S"`] $1"
}
EXTENSION_NAME="[email protected]"
EXTENSION_DIR=$(dirname "$0") # Assumes pack.sh is in the main directory
DIST_DIR="${EXTENSION_DIR}/dist"
# Check if schemas are compiled
if [ ! -f ./schemas/gschemas.compiled ]; then
command -v glib-compile-schemas >/dev/null 2>&1 || { echo >&2 "glib-compile-schemas is required but it's not installed. Aborting."; exit 1; }
log_message "Compiling schemas..."
glib-compile-schemas ./schemas
fi
# Check if tsc is installed
command -v tsc >/dev/null 2>&1 || { log_message "Error: tsc is required but it's not installed. Aborting."; exit 1; }
# Compile TypeScript
log_message "Building typescript files..."
tsc
# Check for errors
if [ $? -ne 0 ]; then
log_message "Failed to compile TypeScript"
exit 1
fi
exit 0