Repository navigation
Expand file tree
/
Copy pathlaunch.sh
More file actions
executable file
·62 lines (54 loc) · 1.74 KB
/
Copy pathlaunch.sh
File metadata and controls
executable file
·62 lines (54 loc) · 1.74 KB
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
#!/bin/bash
# freeMarkable (Linux/Mac)
# Easy launcher script for freeMarkable
echo "======================================================"
echo " freeMarkable"
echo "======================================================"
echo ""
echo "Starting freeMarkable..."
echo ""
# Get the directory where this script is located
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
RESOURCES_DIR="$DIR/resources"
# Check if Python is available
if ! command -v python3 &> /dev/null; then
echo "ERROR: Python 3 is not installed or not in PATH"
echo "Please install Python 3 and try again."
echo ""
read -p "Press Enter to exit..."
exit 1
fi
# Check if resources directory exists
if [ ! -d "$RESOURCES_DIR" ]; then
echo "ERROR: Resources directory not found at $RESOURCES_DIR"
echo "Please make sure the resources folder is in the same directory as this launcher script."
echo ""
read -p "Press Enter to exit..."
exit 1
fi
# Check if main.py exists in resources
if [ ! -f "$RESOURCES_DIR/main.py" ]; then
echo "ERROR: main.py not found in resources directory"
echo "Please make sure all application files are in the resources folder."
echo ""
read -p "Press Enter to exit..."
exit 1
fi
# Install requirements if needed
if [ -f "$RESOURCES_DIR/requirements.txt" ]; then
echo "Installing Python dependencies..."
python3 -m pip install -r "$RESOURCES_DIR/requirements.txt"
echo ""
fi
# Change to resources directory and run the Python application
cd "$RESOURCES_DIR"
python3 main.py
# Check exit status
if [ $? -eq 0 ]; then
echo ""
echo "Application closed successfully."
else
echo ""
echo "Application exited with an error."
read -p "Press Enter to exit..."
fi