summary refs log tree commit diff stats
path: root/ranger.py
diff options
context:
space:
mode:
authorhut <hut@lavabit.com>2010-09-16 18:19:46 +0200
committerhut <hut@lavabit.com>2010-09-16 18:19:46 +0200
commit4341846741b6623a1ead43485cfd5cf633453bb6 (patch)
treefdfdd0b13329ad457ad9a6a0c0091019396ae64a /ranger.py
parent37a60686b340f030a2fc37e7ac9d19a701de9e6b (diff)
parent0c0849c3d8bf57a8b0d0bd9d6113639c58a28fd2 (diff)
downloadranger-4341846741b6623a1ead43485cfd5cf633453bb6.tar.gz
Merge branch 'master' into cp
Conflicts:
	ranger/__main__.py
	ranger/core/actions.py
Diffstat (limited to 'ranger.py')
-rwxr-xr-xranger.py11
1 files changed, 8 insertions, 3 deletions
diff --git a/ranger.py b/ranger.py
index aca1b557..5652ba69 100755
--- a/ranger.py
+++ b/ranger.py
@@ -23,13 +23,19 @@
 # after you exit ranger by starting it with: source ranger ranger
 """":
 if [ $1 ]; then
-	$@ --fail-if-run && cd "$(grep \^\' ~/.ranger/bookmarks | cut -b3-)"
+	if [ -z "$XDG_CONFIG_HOME" ]; then
+		"$@" --fail-unless-cd && cd "$(grep \^\' ~/.config/ranger/bookmarks | cut -b3-)"
+	else
+		"$@" --fail-unless-cd && cd "$(grep \^\' "$XDG_CONFIG_HOME"/ranger/bookmarks | cut -b3-)"
+	fi
 else
 	echo "usage: source path/to/ranger.py path/to/ranger.py"
 fi
 return 1
 """
 
+import sys
+
 # Redefine the docstring, since the previous one was hijacked to
 # embed a shellscript.
 __doc__ = """Ranger - file browser for the unix terminal"""
@@ -40,7 +46,6 @@ __doc__ = """Ranger - file browser for the unix terminal"""
 try:
 	from ranger.__main__ import main
 except ImportError:
-	import sys
 	if '-d' not in sys.argv and '--debug' not in sys.argv:
 		print("Can't import the main module.")
 		print("To run an uninstalled copy of ranger,")
@@ -48,4 +53,4 @@ except ImportError:
 	else:
 		raise
 else:
-	main()
+	sys.exit(main())