Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

More.

  • Loading branch information...
commit 1c66e27d8571731453d66e059411e17ed44dc4ed 1 parent 4865991
@sjl authored
View
113 bin/lein
@@ -4,13 +4,39 @@
# somewhere on your $PATH, like ~/bin. The rest of Leiningen will be
# installed upon first run into the ~/.lein/self-installs directory.
-export LEIN_VERSION="2.0.0-preview10"
+export LEIN_VERSION="2.0.0"
case $LEIN_VERSION in
*SNAPSHOT) SNAPSHOT="YES" ;;
*) SNAPSHOT="NO" ;;
esac
+if [[ "$OSTYPE" == "cygwin" ]]; then
+ delimiter=";"
+else
+ delimiter=":"
+fi
+
+function make_native_path {
+ # ensure we have native paths
+ if [[ "$OSTYPE" == "cygwin" && "$1" == /* ]]; then
+ echo -n "$(cygpath -wp "$1")"
+ else
+ echo -n "$1"
+ fi
+}
+
+# usage : add_path PATH_VAR [PATH]...
+function add_path {
+ local path_var="$1"
+ shift
+ while [ -n "$1" ];do
+ # http://bashify.com/?Useful_Techniques:Indirect_Variables:Indirect_Assignment
+ export ${path_var}="${!path_var}${delimiter}$(make_native_path "$1")"
+ shift
+ done
+}
+
if [ `id -u` -eq 0 ] && [ "$LEIN_ROOT" = "" ]; then
echo "WARNING: You're currently running as root; probably by accident."
echo "Press control-C to abort or Enter to continue as root."
@@ -29,16 +55,16 @@ do
fi
done
-export LEIN_HOME=${LEIN_HOME:-"$HOME/.lein"}
+export LEIN_HOME="${LEIN_HOME:-"$HOME/.lein"}"
for f in "$LEIN_HOME/leinrc" ".leinrc"; do
- if [ -e $f ]; then
- source $f
+ if [ -e "$f" ]; then
+ source "$f"
fi
done
if [ "$OSTYPE" = "cygwin" ]; then
- export LEIN_HOME=`cygpath -w $LEIN_HOME`
+ export LEIN_HOME=`cygpath -w "$LEIN_HOME"`
fi
LEIN_JAR="$LEIN_HOME/self-installs/leiningen-$LEIN_VERSION-standalone.jar"
@@ -65,16 +91,16 @@ BIN_DIR="$(dirname "$SCRIPT")"
# Try to make the default more sane for :eval-in :classloader.lein
grep -E -q '^\s*:eval-in\s+:classloader\s*$' project.clj 2> /dev/null &&
-LEIN_JVM_OPTS=${LEIN_JVM_OPTS:-'-Xms64m -Xmx512m'}
+LEIN_JVM_OPTS="${LEIN_JVM_OPTS:-"-Xms64m -Xmx512m"}"
if [ -r "$BIN_DIR/../src/leiningen/version.clj" ]; then
# Running from source checkout
LEIN_DIR="$(dirname "$BIN_DIR")"
# Need to use lein 1.x to bootstrap the leiningen-core library (for aether)
- if [ "$(ls $LEIN_DIR/leiningen-core/lib/*)" = "" ]; then
+ if [ "$(ls "$LEIN_DIR"/leiningen-core/lib/*)" = "" ]; then
echo "Leiningen is missing its dependencies."
- echo "Please see \"Building\" in the README."
+ echo "Please see \"Building\" in CONTRIBUTING.md."
exit 1
fi
@@ -95,35 +121,25 @@ if [ -r "$BIN_DIR/../src/leiningen/version.clj" ]; then
cd "$LEIN_DIR"
$0 classpath .lein-classpath
- sum $LEIN_DIR/project.clj $LEIN_DIR/leiningen-core/project.clj > \
+ sum "$LEIN_DIR/project.clj" "$LEIN_DIR/leiningen-core/project.clj" > \
.lein-project-checksum
cd "$ORIG_PWD"
fi
mkdir -p "$LEIN_DIR/target/classes"
- export LEIN_JVM_OPTS="${LEIN_JVM_OPTS:--Xms64m -Xmx256m} -Dclojure.compile.path=$LEIN_DIR/target/classes"
+ export LEIN_JVM_OPTS="${LEIN_JVM_OPTS:-"-Xms64m -Xmx256m"} -Dclojure.compile.path=$LEIN_DIR/target/classes"
+ add_path CLASSPATH "$LEIN_DIR/leiningen-core/src/" "$LEIN_DIR/leiningen-core/resources/" \
+ "$LEIN_DIR/test:$LEIN_DIR/target/classes" "$LEIN_DIR/src" ":$LEIN_DIR/resources"
- CLASSPATH="$LEIN_DIR/leiningen-core/src/"
- CLASSPATH="$CLASSPATH:$LEIN_DIR/leiningen-core/resources/"
if [ -r "$LEIN_DIR/.lein-classpath" ]; then
- CLASSPATH="$CLASSPATH:$(cat $LEIN_DIR/.lein-classpath 2> /dev/null)"
+ add_path CLASSPATH "$(cat "$LEIN_DIR/.lein-classpath" 2> /dev/null)"
else
- CLASSPATH="$CLASSPATH:$LEIN_DIR/leiningen-core/lib/*"
- fi
- CLASSPATH="$CLASSPATH:$LEIN_DIR/test:$LEIN_DIR/target/classes"
- CLASSPATH="$CLASSPATH:$LEIN_DIR/src:$LEIN_DIR/resources:$LEIN_JAR"
- if [ -f .lein-classpath ]; then
- CLASSPATH="`cat .lein-classpath`:$CLASSPATH"
+ add_path CLASSPATH "$LEIN_DIR/leiningen-core/lib/*"
fi
else # Not running from a checkout
- # apply context specific CLASSPATH entries
- if [ -f .lein-classpath ]; then
- CLASSPATH="`cat .lein-classpath`:$LEIN_JAR"
- else
- CLASSPATH="$LEIN_JAR"
- fi
+ add_path CLASSPATH "$LEIN_JAR"
- export LEIN_JVM_OPTS=${LEIN_JVM_OPTS:-"-Xbootclasspath/a:$LEIN_JAR"}
+ BOOTCLASSPATH="-Xbootclasspath/a:$LEIN_JAR"
if [ ! -r "$LEIN_JAR" -a "$1" != "self-install" ]; then
"$0" self-install
@@ -152,8 +168,12 @@ function download_failed_message {
}
# TODO: explain what to do when Java is missing
-export JAVA_CMD=${JAVA_CMD:-"java"}
-export LEIN_JAVA_CMD=${LEIN_JAVA_CMD:-$JAVA_CMD}
+export JAVA_CMD="${JAVA_CMD:-"java"}"
+export LEIN_JAVA_CMD="${LEIN_JAVA_CMD:-$JAVA_CMD}"
+
+if [[ "$(basename "$LEIN_JAVA_CMD")" == *drip* ]]; then
+ export DRIP_INIT="$(printf -- '-e\n(require (quote leiningen.repl))')"
+fi
# Support $JAVA_OPTS for backwards-compatibility.
export JVM_OPTS="${JVM_OPTS:-"$JAVA_OPTS"}"
@@ -167,10 +187,9 @@ if [ "$1" = "self-install" ]; then
echo "If you wish to re-download, delete it and rerun \"$0 self-install\"."
exit 1
fi
- echo "Downloading Leiningen now..."
- LEIN_DIR=`dirname "$LEIN_JAR"`
- mkdir -p "$LEIN_DIR"
- LEIN_URL="https://github.com/downloads/technomancy/leiningen/leiningen-$LEIN_VERSION-standalone.jar"
+ echo "Downloading Leiningen to $LEIN_JAR now..."
+ mkdir -p "$(dirname "$LEIN_JAR")"
+ LEIN_URL="https://leiningen.s3.amazonaws.com/downloads/leiningen-$LEIN_VERSION-standalone.jar"
$HTTP_CLIENT "$LEIN_JAR.pending" "$LEIN_URL"
if [ $? == 0 ]; then
# TODO: checksum
@@ -197,7 +216,8 @@ elif [ "$1" = "upgrade" ]; then
echo "You do not have permission to upgrade the installation in $SCRIPT"
exit 1
else
- TARGET_VERSION="${2:-"preview"}"
+ # TODO: change to stable when 2.0.0 is released
+ TARGET_VERSION="${2:-preview}"
echo "The script at $SCRIPT will be upgraded to the latest $TARGET_VERSION version."
echo -n "Do you want to continue [Y/n]? "
read RESP
@@ -229,21 +249,26 @@ else
if [ "$OSTYPE" = "cygwin" ]; then
# When running on Cygwin, use Windows-style paths for java
ORIGINAL_PWD=`cygpath -w "$ORIGINAL_PWD"`
- CLASSPATH=`cygpath -wp "$CLASSPATH"`
+ fi
+
+ # apply context specific CLASSPATH entries
+ if [ -f .lein-classpath ]; then
+ add_path CLASSPATH "$(cat .lein-classpath)"
fi
if [ $DEBUG ]; then
echo "Leiningen's classpath: $CLASSPATH"
fi
- if [ "$LEIN_FAST_TRAMPOLINE" = "" ] && [ ! -r .lein-fast-trampoline ]; then
- TRAMPOLINE_FILE="/tmp/lein-trampoline-$$"
- trap "rm -f $TRAMPOLINE_FILE" EXIT
- else
- INPUTS="$@ $(cat project.clj) $(cat $LEIN_HOME/profiles.clj)"
+ if ([ "$LEIN_FAST_TRAMPOLINE" != "" ] || [ -r .lein-fast-trampoline ]) &&
+ [ -r project.clj ]; then
+ INPUTS="$@ $(cat project.clj) $(cat "$LEIN_HOME/profiles.clj")"
INPUT_CHECKSUM=$(echo $INPUTS | shasum - | cut -f 1 -d " ")
# Just don't change :target-path in project.clj, mkay?
TRAMPOLINE_FILE="target/trampolines/$INPUT_CHECKSUM"
+ else
+ TRAMPOLINE_FILE="/tmp/lein-trampoline-$$"
+ trap "rm -f $TRAMPOLINE_FILE" EXIT
fi
if [ "$OSTYPE" = "cygwin" ]; then
@@ -256,19 +281,21 @@ else
fi
exec sh -c "exec $(cat $TRAMPOLINE_FILE)"
else
- $LEIN_JAVA_CMD \
+ export TRAMPOLINE_FILE
+ "$LEIN_JAVA_CMD" \
-client -XX:+TieredCompilation \
+ "${BOOTCLASSPATH[@]}" \
$LEIN_JVM_OPTS \
-Dfile.encoding=UTF-8 \
-Dmaven.wagon.http.ssl.easy=false \
-Dleiningen.original.pwd="$ORIGINAL_PWD" \
- -Dleiningen.trampoline-file="$TRAMPOLINE_FILE" \
- -cp "$CLASSPATH" \
+ -Dleiningen.script="$SCRIPT" \
+ -classpath "$CLASSPATH" \
clojure.main -m leiningen.core.main "$@"
EXIT_CODE=$?
- if [ -r "$TRAMPOLINE_FILE" ]; then
+ if [ -r "$TRAMPOLINE_FILE" ] && [ "$LEIN_TRAMPOLINE_WARMUP" = "" ]; then
TRAMPOLINE="$(cat $TRAMPOLINE_FILE)"
if [ "$INPUT_CHECKSUM" = "" ]; then
rm $TRAMPOLINE_FILE
View
3  dotcss/okcupid.com.css
@@ -1 +1,4 @@
#loveisblindday { display: none; }
+#likeonfacebook { display: none; }
+#masthead_wrapper { display: none !important; }
+#movie_match_promo { display: none !important; }
View
7 fish/config.fish
@@ -1,4 +1,4 @@
-# Useful function {{{; $argv; end
+# Useful functions {{{
function serve_this; python -m SimpleHTTPServer; end
# alias fab 'fab -i ~/.ssh/stevelosh'
@@ -24,12 +24,15 @@ function et; vim ~/.tmux.conf; end
function eg; vim ~/.gitconfig; end
function es; vim ~/.slate; end
+function ss; bcvi --wrap-ssh -- $argv; end
+function bcvid; dtach -A /tmp/bcvi.socket bcvi --listener; end
+
function spotlight-off; sudo mdutil -a -i off ; and sudo mv /System/Library/CoreServices/Search.bundle/ /System/Library/CoreServices/SearchOff.bundle/ ; and killall SystemUIServer; end
function spotlight-on; sudo mdutil -a -i on ; and sudo mv /System/Library/CoreServices/SearchOff.bundle/ /System/Library/CoreServices/Search.bundle/ ; and killall SystemUIServer; end
function spotlight-wat; sudo fs_usage -w -f filesys mdworker | grep "open" ; end
set MUTT_BIN (which mutt)
-function mutt; bash --login -c 'cd ~/Desktop; $MUTT_BIN'; end
+function mutt; bash --login -c "cd ~/Desktop; $MUTT_BIN"; end
function h; hg $argv; end
function g; git $argv; end
View
2  gitconfig
@@ -50,7 +50,7 @@
delete-remote-branch = push origin --delete
delete-local-reference-to-remote-branch = branch -rd
- currentbranch = !git branch --contains HEAD | grep '*' | tr -s ' ' | cut -d ' ' -f2
+ currentbranch = rev-parse --abbrev-ref HEAD
fo = fetch origin
fu = fetch upstream
View
2  vim/vimrc
@@ -350,7 +350,7 @@ vnoremap Q gq
" Reformat line.
" I never use l as a macro register anyway.
-nnoremap ql ^vg_gq
+nnoremap ql gqq
" Easier linewise reselection
nnoremap <leader>V V`]
Please sign in to comment.
Something went wrong with that request. Please try again.