diff --git a/skratch.py b/skratch.py index 695b3da..d88bf9a 100755 --- a/skratch.py +++ b/skratch.py @@ -11,11 +11,11 @@ def make_dir(d): os.mkdir(d) def delete_all(d): - fc = list_all(d) - if fc: + files = list_all(d) + if files: x = input("Delete the above files? y/N ") if x.lower() == 'y': - for file in os.listdir(d): + for file in files: f = os.path.join(d,file) os.remove(f) print(f"removing: {f}") @@ -31,7 +31,7 @@ def list_all(d): else: for file in files: print(file) - return len(files) + return files def get_editor(use_v): v = os.getenv("VISUAL")