summary refs log tree commit diff stats
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
parent7582555b50f058b316c04ce8ab977bed36da1585 (diff)
downloadranger-5d4f9249860ea66b929a3a0c4d215cf35067b5f8.tar.gz
ranger.main: don't create ~/.ranger if --clean is specified
-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
129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231