summary refs log tree commit diff stats
path: root/ranger/__init__.py
diff options
context:
space:
mode:
Diffstat (limited to 'ranger/__init__.py')
-rw-r--r--ranger/__init__.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/ranger/__init__.py b/ranger/__init__.py
index 4f223b7d..7a09dbe3 100644
--- a/ranger/__init__.py
+++ b/ranger/__init__.py
@@ -64,6 +64,18 @@ def relpath_conf(*paths):
 	else:
 		return os.path.join(arg.confdir, *paths)
 
+def relpath_script(*paths):
+	"""
+	Returns the path relative to where scripts are stored.
+
+	It's relpath('data', *paths) with the --clean flag and
+	relpath_conf(*paths) without --clean.
+	"""
+	if arg.clean:
+		return relpath('data', *paths)
+	else:
+		return relpath_conf(*paths)
+
 def relpath(*paths):
 	"""returns the path relative to rangers library directory"""
 	return os.path.join(RANGERDIR, *paths)