changeset 4599:f3f75edfba05

<fizzie> sed -i -e \'s/sys,/sys, os.path,/\' -e \'5{p;s/.*/ f = os.path.abspath(sys.argv[1])/}\' -e \'s/sys.argv\\[1\\]/f/\' bin/url
author HackBot
date Sun, 20 Apr 2014 08:04:08 +0000
parents 1bc67ded06c4
children c61591186709
files bin/url
diffstat 1 files changed, 3 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/bin/url	Sun Apr 20 00:49:11 2014 +0000
+++ b/bin/url	Sun Apr 20 08:04:08 2014 +0000
@@ -1,9 +1,10 @@
 #!/usr/bin/env python
-import sys, re, urllib
+import sys, os.path, re, urllib
 if len(sys.argv) <= 1:
     print "http://codu.org/projects/hackbot/fshg/"
 else:
-    f = re.sub(r"^/+hackenv/", "", sys.argv[1])
+    f = os.path.abspath(f)
+    f = re.sub(r"^/+hackenv/", "", f)
     if f.startswith("/"):
         sys.exit("File is outside hg repository.")
     else: