Quit using that nasty $ESCAPED_ARGS hack for leiningen.core/-main.

This commit is contained in:
Phil Hagelberg 2010-04-16 22:34:45 -07:00
parent 38bcf71e8d
commit 9fd8cb23e7
2 changed files with 18 additions and 20 deletions

View file

@ -52,12 +52,6 @@ if [ $DEBUG ]; then
echo $CLASSPATH
fi
# escape command-line arguments so they can be evaled as strings
ESCAPED_ARGS=""
for ARG in "$@"; do
ESCAPED_ARGS="$ESCAPED_ARGS"' "'$(echo $ARG | sed -e 's/\\/\\\\/g' -e 's/"/\\"/g')'"'
done
HTTP_CLIENT="wget -O"
if type -p curl >/dev/null 2>&1; then
HTTP_CLIENT="curl -L -o"
@ -120,5 +114,7 @@ else
# The -Xbootclasspath argument is optional here: if the jar
# doesn't exist everything will still work, it will just have a
# slower JVM boot.
exec $RLWRAP java -Xbootclasspath/a:"$CLOJURE_JAR" -client $JAVA_OPTS -cp "$CLASSPATH" -Dleiningen.version="$VERSION" $JLINE clojure.main -e "(use 'leiningen.core)(-main $ESCAPED_ARGS)"
exec $RLWRAP java -Xbootclasspath/a:"$CLOJURE_JAR" -client $JAVA_OPTS \
-cp "$CLASSPATH" -Dleiningen.version="$VERSION" $JLINE \
clojure.main -e "(use 'leiningen.core)(-main)" /dev/null $@
fi

View file

@ -80,7 +80,8 @@
(replace \_ \-)
(replace \/ \.)))
(defn -main [& [task & args]]
(defn -main
([& [task & args]]
(let [task (or (aliases task) task "help")
args (if (@no-project-needed task)
args
@ -93,3 +94,4 @@
(apply (resolve-task task) args))
;; In case tests or some other task started any:
(shutdown-agents)))
([] (apply -main *command-line-args*)))