Created
December 2, 2010 15:50
-
-
Save robyurkowski/725549 to your computer and use it in GitHub Desktop.
Lines for checking if symlinked, setting appropriate load path, and `chdir`ing for file reads
This file contains hidden or 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 ruby | |
THIS_FILE = File.symlink?(__FILE__) ? File.readlink(__FILE__) : __FILE__ | |
$LOAD_PATH.unshift File.expand_path(File.dirname(THIS_FILE)) | |
Dir.chdir(File.expand_path(File.dirname(THIS_FILE))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment