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,40 @@
77+#!/usr/bin/env bash
78+
79+base_path=@basePath@
80+pixie_path=@pixiePath@
81+rlwrap_cmd=@rlwrapPath@
82+
83+function set_load_path() {
84+ load_path=""
85+ if ([ -f "project.edn" ] || [ -f "project.pxi" ]) && [ -f ".load-path" ]; then
86+ load_path="`cat .load-path`"
87+ fi
88+}
89+
90+if [ ! -f "project.edn" ] && [ -f "project.pxi" ]; then
91+ echo "Warning: 'project.pxi' is deprecated, please use 'project.edn'."
92+ echo "To start you can run the following command:"
93+ echo " pixie-vm -l $base_path/src -e '(require dust.project :as p) (p/load-project!) (prn (dissoc @p/*project* :path))'"
94+ echo
95+fi
96+
97+set_load_path
98+run_dust="$pixie_path -l $base_path/src $load_path $base_path/run.pxi"
99+
100+case $1 in
101+ ""|"repl")
102+ $rlwrap_cmd -aignored -n $pixie_path $load_path
103+ ;;
104+ "run")
105+ shift
106+ file=$1
107+ shift
108+ $pixie_path $load_path $file $@
109+ ;;
110+ -h|--help)
111+ $run_dust help
112+ ;;
113+ *)
114+ $run_dust $@
115+ ;;
116+esac
117--
1182.7.1
119