forked from heronarts/LXStudio-IDE
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathswitch-native.sh
More file actions
executable file
·39 lines (32 loc) · 850 Bytes
/
switch-native.sh
File metadata and controls
executable file
·39 lines (32 loc) · 850 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
#!/bin/bash
set -eu
readonly LXSTUDIO_PATH=$(dirname $(realpath $0))
readonly PROCESSING_PATH="${LXSTUDIO_PATH}/lib/processing-4.0.1"
readonly NATIVE_SYMLINK_PATH="${PROCESSING_PATH}/native"
function usage() {
echo "Usage: switch-native.sh [arch]"
echo
echo "Switches LXStudio processing native architecture to arch."
echo
echo "Available architectures:"
echo
tree -d -L 1 "${PROCESSING_PATH}"
}
if [ $# -ne 1 ]; then
usage
exit 1
else
readonly DIR_TO_LINK="${PROCESSING_PATH}/$1"
if [ ! -d "${DIR_TO_LINK}" ]; then
echo "No directory $1 in ${PROCESSING_PATH}, aborting."
echo
usage
exit 1
fi
if [ -L "${NATIVE_SYMLINK_PATH}" ]; then
echo "Deleting existing native symlink."
rm "${NATIVE_SYMLINK_PATH}"
fi
echo "Switched LXStudio native library to $1 architecture."
(cd "${PROCESSING_PATH}" && ln -s $1 native)
fi