summary refs log tree commit diff stats
path: root/ranger
diff options
context:
space:
mode:
authorhut <hut@lavabit.com>2010-03-12 19:20:57 +0100
committerhut <hut@lavabit.com>2010-03-12 19:20:57 +0100
commit5d4f9249860ea66b929a3a0c4d215cf35067b5f8 (patch)
tree8dba280707f9cea6a46d78413494b4525f766327 /ranger
parent7582555b50f058b316c04ce8ab977bed36da1585 (diff)
downloadranger-5d4f9249860ea66b929a3a0c4d215cf35067b5f8.tar.gz
ranger.main: don't create ~/.ranger if --clean is specified
Diffstat (limited to 'ranger')
-rw-r--r--ranger/__main__.py20
1 files changed, 10 insertions, 10 deletions
diff --git a/ranger/__main__.py b/ranger/__main__.py
index aa0785e3..9c97e190 100644
--- a/ranger/__main__.py
+++ b/ranger/__main__.py
@@ -62,17 +62,17 @@ def parse_arguments():
 	if arg.cd_after_exit:
 		sys.stderr = sys.__stdout__
 
-	try:
-		os.makedirs(arg.confdir)
-	except OSError as err:
-		if err.errno != 17:  # 17 means it already exists
-			print("This configuration directory could not be created:")
-			print(arg.confdir)
-			print("To run ranger without the need for configuration files")
-			print("use the --clean option (not implemented yet)")
-			raise SystemExit()
-
 	if not arg.clean:
+		try:
+			os.makedirs(arg.confdir)
+		except OSError as err:
+			if err.errno != 17:  # 17 means it already exists
+				print("This configuration directory could not be created:")
+				print(arg.confdir)
+				print("To run ranger without the need for configuration files")
+				print("use the --clean option.")
+				raise SystemExit()
+
 		sys.path.append(arg.confdir)
 
 	return arg