-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrun-cli.sh
More file actions
41 lines (32 loc) · 1.06 KB
/
run-cli.sh
File metadata and controls
41 lines (32 loc) · 1.06 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
#!/bin/bash
echo "🎵 Random Music Generator - Command Line Version 🎵"
echo "=================================================="
# Check if Java and Maven are installed
if ! command -v java &> /dev/null; then
echo "❌ Java is not installed. Please install Java 11 or higher."
exit 1
fi
if ! command -v mvn &> /dev/null; then
echo "❌ Maven is not installed. Please install Maven 3.6 or higher."
exit 1
fi
echo "✅ Java and Maven are installed"
echo "Java version: $(java -version 2>&1 | head -n 1)"
echo "Maven version: $(mvn -version | head -n 1)"
echo ""
echo "🔨 Building project..."
mvn clean compile
if [ $? -eq 0 ]; then
echo "✅ Project built successfully!"
else
echo "❌ Build failed!"
exit 1
fi
echo ""
echo "🚀 Starting command line application..."
echo "This version works reliably and has all the same features!"
# Start the application using Maven exec plugin
mvn exec:java -Dexec.mainClass="com.musicgenerator.MusicGeneratorApp"
echo ""
echo "🎉 Application closed."
echo "🎵 Thank you for using Random Music Generator!"