summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoe Crayne <joe@jerkface.net>2020-01-13 23:18:14 -0500
committerJoe Crayne <joe@jerkface.net>2020-01-13 23:59:37 -0500
commit49c11b425107786c9b696a2a535eb31f6f371df7 (patch)
treeb86a79d665d3f580c21a24fdb15b771bac960a1d
parentb358d4b044fd8ef1bb18ac15779b3bdf8f2556d5 (diff)
Updated ./run.sh script.HEADmaster
-rwxr-xr-xrun.sh22
1 files changed, 16 insertions, 6 deletions
diff --git a/run.sh b/run.sh
index eb97199..c724a32 100755
--- a/run.sh
+++ b/run.sh
@@ -1,4 +1,4 @@
1#!/bin/sh 1#!/bin/bash
2 2
3# MESA_GLSL_VERSION_OVERRIDE 3# MESA_GLSL_VERSION_OVERRIDE
4# 4#
@@ -41,15 +41,25 @@
41 41
42#cmd=gix 42#cmd=gix
43cmd=meshsketch 43cmd=meshsketch
44cmdpath=$(ls -1ta $(find .stack-work/ dist/ dist-newstyle -type f -name $cmd 2>/dev/null) | head -n1)
44 45
45quiet() { "$@" >/dev/null 2>&1; } 46[ -n "$cmdpath" ] || stack build
46 47
47quiet which $cmd || quiet stack exec -- which $cmd || stack build 48cmdpath=$(ls -1ta $(find .stack-work/ dist/ dist-newstyle -type f -name $cmd 2>/dev/null) | head -n1)
48 49
49[ -e .stack-work ] && run='stack run --' || run= 50if [ "${cmdpath#.stack-work}" = "$cmdpath" ]; then
51 lc=./lc
52else
53 lc="stack run -- lc"
54fi
55
56export MESA_GL_VERSION_OVERRIDE=3.3
57export MESA_GLSL_VERSION_OVERRIDE=330
58
59set -x
50 60
51if [ "$cmd" = meshsketch ]; then 61if [ "$cmd" = meshsketch ]; then
52 [ -e hello_obj2.json ] || $run lc hello_obj2.lc 62 [ ! -e hello_obj2.json -o hello_obj2.json -ot hello_obj2.lc ] && $lc hello_obj2.lc
53fi 63fi
54 64
55MESA_GL_VERSION_OVERRIDE=3.3 MESA_GLSL_VERSION_OVERRIDE=330 $run $cmd 65$cmdpath "$@"