Mercurial Hosting > editor
diff scripts/install.sh @ 65:a4a97e8c204f default tip
mac build
author | Franklin Schmidt <fschmidt@gmail.com> |
---|---|
date | Fri, 06 Jun 2025 00:29:38 -0600 |
parents | 855669ece914 |
children |
line wrap: on
line diff
--- a/scripts/install.sh Thu Jun 05 12:48:30 2025 -0600 +++ b/scripts/install.sh Fri Jun 06 00:29:38 2025 -0600 @@ -12,20 +12,40 @@ export DICTIONARIES="$(pwd)/dictionaries/" for i in "$(pwd)"/jars/* ; do CLASSPATH="\$CLASSPATH:\$i" ; done -CLASSPATH="\$(echo -n \$CLASSPATH | sed 's/^://')" +CLASSPATH="\$(echo -n "\$CLASSPATH" | sed 's/^://')" mkdir -p ~/.luan_editor set +m +End -JAVA_OPTS='-Dfoo' -if [[ "\$(uname)" == "Darwin" ]]; then - JAVA_OPTS='-Xdock:name=Luan Editor' +if [[ "$(uname)" == "Darwin" ]]; then + +cat >>/usr/local/bin/luan_editor <<End + +function runJava() { + 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 & +} + +if [[ \$# == 0 ]]; then + runJava +else + for file in "\$@"; do + runJava "\$file" + sleep 0.1 + done fi +End -java "\$JAVA_OPTS" -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 & +else + +cat >>/usr/local/bin/luan_editor <<End + +java -Duser.home="\$HOME" -classpath "\$CLASSPATH" luan.Luan classpath:luan_editor/editor.luan "\$@" 2>&1 | tee ~/.luan_editor/error.log & End +fi + chmod +x /usr/local/bin/luan_editor -echo "the command 'luan_editor' has been installed" +echo "The command 'luan_editor' has been installed"