comparison scripts/install.sh @ 71:99ebb6176d2f default tip

better build
author Franklin Schmidt <fschmidt@gmail.com>
date Thu, 12 Jun 2025 17:08:31 -0600
parents a4a97e8c204f
children
comparison
equal deleted inserted replaced
70:f4e393a13d59 71:99ebb6176d2f
5 5
6 mkdir -p /usr/local/bin 6 mkdir -p /usr/local/bin
7 7
8 cat >/usr/local/bin/luan_editor <<End 8 cat >/usr/local/bin/luan_editor <<End
9 #!/bin/bash 9 #!/bin/bash
10 set -e
11 10
12 export DICTIONARIES="$(pwd)/dictionaries/" 11 "$(pwd)/luan_editor.sh" "\$@"
13
14 for i in "$(pwd)"/jars/* ; do CLASSPATH="\$CLASSPATH:\$i" ; done
15 CLASSPATH="\$(echo -n "\$CLASSPATH" | sed 's/^://')"
16
17 mkdir -p ~/.luan_editor
18
19 set +m
20 End 12 End
21
22 if [[ "$(uname)" == "Darwin" ]]; then
23
24 cat >>/usr/local/bin/luan_editor <<End
25
26 function runJava() {
27 java -Xdock:name="Luan Editor" -Duser.home="\$HOME" -classpath "\$CLASSPATH" luan.Luan classpath:luan_editor/editor.luan "\$@" 2>&1 | grep --line-buffered -v 'NSRemoteView\|NSSavePanel' | tee ~/.luan_editor/error.log &
28 }
29
30 if [[ \$# == 0 ]]; then
31 runJava
32 else
33 for file in "\$@"; do
34 runJava "\$file"
35 sleep 0.1
36 done
37 fi
38 End
39
40 else
41
42 cat >>/usr/local/bin/luan_editor <<End
43
44 java -Duser.home="\$HOME" -classpath "\$CLASSPATH" luan.Luan classpath:luan_editor/editor.luan "\$@" 2>&1 | tee ~/.luan_editor/error.log &
45 End
46
47 fi
48 13
49 chmod +x /usr/local/bin/luan_editor 14 chmod +x /usr/local/bin/luan_editor
50 15
51 echo "The command 'luan_editor' has been installed" 16 echo "The command 'luan_editor' has been installed"