From 92a524ce6f086e9c702e04a5b80cee490acea3d4 Mon Sep 17 00:00:00 2001 From: Lasse Studion Date: Sun, 18 Dec 2022 10:52:13 +0100 Subject: [PATCH] Check for and create tmp folder --- twitterbot.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/twitterbot.py b/twitterbot.py index 71257e2..15f2da3 100644 --- a/twitterbot.py +++ b/twitterbot.py @@ -32,6 +32,14 @@ def start_bot(default=True): if __name__ == "__main__": + # Change working directory to the scripts' directory. + os.chdir(os.path.dirname(os.path.realpath(__file__))) + + # Create the tmp folder if it does not exists. + path_tmp = os.path.dirname(os.path.realpath(__file__)) + '/tmp' + if not os.path.exists(path_tmp): + os.mkdir(path_tmp) + conf = config.get_config(check_for=['dropbox_refresh_token', 'twitter_access_token_secret']) if len(sys.argv) > 1: