diff --git a/skratch.py b/skratch.py index 9672b16..7781734 100755 --- a/skratch.py +++ b/skratch.py @@ -4,11 +4,7 @@ import os import argparse import time import tempfile - -def make_dir(d): - if not os.path.exists(d): - os.mkdir(d) - + def delete_all(d): files = list_all(d) if not files: @@ -57,7 +53,7 @@ def run(editor, sk_path, filename=None): def main(): home_path = os.getenv("HOME") sk_path = os.path.join(home_path, ".skratch") - make_dir(sk_path) + os.makedirs(sk_path, exist_ok=True) parser = argparse.ArgumentParser( prog='skratch',