at 18.09-beta 3.0 kB view raw
1From 0cbb82e606610d36e52c70d888995fbbf9b0d7c8 Mon Sep 17 00:00:00 2001 2From: Herwig Hochleitner <herwig@bendlas.net> 3Date: Sun, 28 Feb 2016 16:34:14 +0100 4Subject: [PATCH] make paths configurable 5 6--- 7 dust | 52 ---------------------------------------------------- 8 dust.in | 43 +++++++++++++++++++++++++++++++++++++++++++ 9 2 files changed, 43 insertions(+), 52 deletions(-) 10 delete mode 100755 dust 11 create mode 100755 dust.in 12 13diff --git a/dust b/dust 14deleted file mode 100755 15index ffced9b..0000000 16--- a/dust 17+++ /dev/null 18@@ -1,52 +0,0 @@ 19-#!/usr/bin/env bash 20- 21-base_path=$0 22-if [ -L "$base_path" ]; then 23- base_path=`readlink $base_path` 24-fi 25-base_path=`dirname $base_path` 26- 27-pixie_path=`which pixie-vm` 28-if [ -z "$pixie_path" ]; then 29- echo "Error: 'pixie-vm' must be on your PATH" 30- exit 1 31-fi 32- 33-function set_load_path() { 34- load_path="" 35- if ([ -f "project.edn" ] || [ -f "project.pxi" ]) && [ -f ".load-path" ]; then 36- load_path="`cat .load-path`" 37- fi 38-} 39- 40-if [ ! -f "project.edn" ] && [ -f "project.pxi" ]; then 41- echo "Warning: 'project.pxi' is deprecated, please use 'project.edn'." 42- echo "To start you can run the following command:" 43- echo " pixie-vm -l $base_path/src -e '(require dust.project :as p) (p/load-project!) (prn (dissoc @p/*project* :path))'" 44- echo 45-fi 46- 47-set_load_path 48-run_dust="$pixie_path -l $base_path/src $load_path $base_path/run.pxi" 49- 50-case $1 in 51- ""|"repl") 52- rlwrap_cmd="" 53- if [ -n "`which rlwrap`" ]; then 54- rlwrap_cmd="rlwrap -aignored -n" 55- fi 56- $rlwrap_cmd $pixie_path $load_path 57- ;; 58- "run") 59- shift 60- file=$1 61- shift 62- $pixie_path $load_path $file $@ 63- ;; 64- -h|--help) 65- $run_dust help 66- ;; 67- *) 68- $run_dust $@ 69- ;; 70-esac 71diff --git a/dust.in b/dust.in 72new file mode 100755 73index 0000000..44a7fbd 74--- /dev/null 75+++ b/dust.in 76@@ -0,0 +1,43 @@ 77+#!/usr/bin/env bash 78+ 79+base_path=@basePath@ 80+pixie_path=@pixiePath@ 81+ 82+function set_load_path() { 83+ load_path="" 84+ if ([ -f "project.edn" ] || [ -f "project.pxi" ]) && [ -f ".load-path" ]; then 85+ load_path="`cat .load-path`" 86+ fi 87+} 88+ 89+if [ ! -f "project.edn" ] && [ -f "project.pxi" ]; then 90+ echo "Warning: 'project.pxi' is deprecated, please use 'project.edn'." 91+ echo "To start you can run the following command:" 92+ echo " pixie-vm -l $base_path/src -e '(require dust.project :as p) (p/load-project!) (prn (dissoc @p/*project* :path))'" 93+ echo 94+fi 95+ 96+set_load_path 97+run_dust="$pixie_path -l $base_path/src $load_path $base_path/run.pxi" 98+ 99+case $1 in 100+ ""|"repl") 101+ rlwrap_cmd="" 102+ if [ -n "`which rlwrap`" ]; then 103+ rlwrap_cmd="rlwrap -aignored -n" 104+ fi 105+ $rlwrap_cmd $pixie_path $load_path 106+ ;; 107+ "run") 108+ shift 109+ file=$1 110+ shift 111+ $pixie_path $load_path $file $@ 112+ ;; 113+ -h|--help) 114+ $run_dust help 115+ ;; 116+ *) 117+ $run_dust $@ 118+ ;; 119+esac 120-- 1212.7.1 122