Created
June 26, 2010 23:20
-
-
Save michalmarczyk/454436 to your computer and use it in GitHub Desktop.
Clojure launcher script written in Python
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import os | |
import sys | |
class_path = [] | |
dot_clojure = os.path.join(os.environ['HOME'], '.clojure') | |
dot_jars = os.path.join(os.environ['HOME'], '.jars') | |
for filename in os.listdir(dot_clojure): | |
if filename[-4:] == '.jar': | |
class_path.append(os.path.join(dot_clojure, filename)) | |
for filename in os.listdir(dot_jars): | |
if filename[-4:] == '.jar': | |
class_path.append(os.path.join(dot_jars, filename)) | |
class_path_str = ':'.join(class_path) | |
os.execvp('rlwrap', [ | |
'rlwrap', | |
'java', '-cp', class_path_str, | |
'jline.ConsoleRunner', 'clojure.main' | |
] + sys.argv[1:]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment