Skip to content

Commit 0517861

Browse files
committed
Create fetch_processing_jar.sh
The script will check the OS and architecture of the machine its running on and download the appropriate JAR file
1 parent be50144 commit 0517861

1 file changed

Lines changed: 46 additions & 0 deletions

File tree

‎fetch_processing_jar.sh‎

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
#!/bin/bash
2+
3+
# Define global constants for URLs
4+
URL_LINUX64="http://py.processing.org/processing.py-linux64.tgz"
5+
URL_LINUX32="http://py.processing.org/processing.py-linux32.tgz"
6+
URL_MAC="http://py.processing.org/processing.py-macosx.tgz"
7+
URL_WINDOWS64="http://py.processing.org/processing.py-windows64.zip"
8+
URL_WINDOWS32="http://py.processing.org/processing.py-windows32.zip"
9+
10+
# Detect the operating system
11+
OS="unknown"
12+
case "$(uname -s)" in
13+
Linux*) OS="Linux";;
14+
Darwin*) OS="Mac";;
15+
CYGWIN*|MINGW*|MSYS*) OS="Windows";;
16+
*) OS="UNKNOWN";;
17+
esac
18+
19+
# Detect the architecture
20+
ARCH=$(uname -m)
21+
URL=""
22+
23+
if [ "$OS" == "Linux" ]; then
24+
if [ "$ARCH" == "x86_64" ]; then
25+
URL="$URL_LINUX64"
26+
elif [ "$ARCH" == "i386" ] || [ "$ARCH" == "i686" ]; then
27+
URL="$URL_LINUX32"
28+
fi
29+
elif [ "$OS" == "Mac" ]; then
30+
URL="$URL_MAC"
31+
elif [ "$OS" == "Windows" ]; then
32+
# Assuming WSL for Windows
33+
if [ "$ARCH" == "x86_64" ]; then
34+
URL="$URL_WINDOWS64"
35+
else
36+
URL="$URL_WINDOWS32"
37+
fi
38+
fi
39+
40+
if [ -z "$URL" ]; then
41+
echo "Unsupported OS or architecture: $OS $ARCH" >&2
42+
exit 1
43+
fi
44+
45+
echo "Downloading Processing.py for $OS ($ARCH)"
46+
wget -O processing.py-archive "$URL" && tar -xvzf processing.py-archive -C /usr/src/app

0 commit comments

Comments
 (0)