Skip to content

Instantly share code, notes, and snippets.

@jamesoff
Created January 23, 2014 16:21
Show Gist options
  • Save jamesoff/8581559 to your computer and use it in GitHub Desktop.
Save jamesoff/8581559 to your computer and use it in GitHub Desktop.
Teach s3cmd to look in environment for location of its config
--- s3cmd.orig 2014-01-23 15:52:08.000000000 +0000
+++ s3cmd 2014-01-23 15:56:12.000000000 +0000
@@ -1692,7 +1692,9 @@
#optparser.disable_interspersed_args()
config_file = None
- if os.getenv("HOME"):
+ if os.getenv("S3CFG"):
+ config_file = os.getenv("S3CFG")
+ elif os.getenv("HOME"):
config_file = os.path.join(os.getenv("HOME"), ".s3cfg")
elif os.name == "nt" and os.getenv("USERPROFILE"):
config_file = os.path.join(os.getenv("USERPROFILE").decode('mbcs'), "Application Data", "s3cmd.ini")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment