Skip to content

Instantly share code, notes, and snippets.

@qertoip
Created August 1, 2010 14:46
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save qertoip/503434 to your computer and use it in GitHub Desktop.
Save qertoip/503434 to your computer and use it in GitHub Desktop.
clj.bat - dopracowany, uniwersalny wołacz clojura na Windows
:: Setup:
::
:: 1. Change the constants to match your paths
:: 2. Put this clj.bat file on your PATH
::
:: Usage:
::
:: clj # Starts REPL
:: clj my_script.clj # Runs the script
:: clj my_script.clj arg1 arg2 # Runs the script with arguments
@echo off
:: Change the following to match your paths
set CLOJURE_DIR=D:\clojure-1.2.0
set CLOJURE_JAR=%CLOJURE_DIR%\clojure-1.2.0.jar
set CONTRIB_JAR=%CLOJURE_DIR%\clojure-contrib-1.2.0.jar
set JLINE_JAR=%CLOJURE_DIR%\jline-0.9.94.jar
if (%1) == () (
:: Start REPL
java -cp .;%JLINE_JAR%;%CLOJURE_JAR%;%CONTRIB_JAR% jline.ConsoleRunner clojure.main
) else (
:: Start some_script.clj
java -cp .;%CLOJURE_JAR%;%CONTRIB_JAR% clojure.main %1 -- %*
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment