cleanup makedir
This commit is contained in:
parent
77f313001a
commit
842daf7924
1 changed files with 2 additions and 6 deletions
|
|
@ -4,11 +4,7 @@ import os
|
||||||
import argparse
|
import argparse
|
||||||
import time
|
import time
|
||||||
import tempfile
|
import tempfile
|
||||||
|
|
||||||
def make_dir(d):
|
|
||||||
if not os.path.exists(d):
|
|
||||||
os.mkdir(d)
|
|
||||||
|
|
||||||
def delete_all(d):
|
def delete_all(d):
|
||||||
files = list_all(d)
|
files = list_all(d)
|
||||||
if not files:
|
if not files:
|
||||||
|
|
@ -57,7 +53,7 @@ def run(editor, sk_path, filename=None):
|
||||||
def main():
|
def main():
|
||||||
home_path = os.getenv("HOME")
|
home_path = os.getenv("HOME")
|
||||||
sk_path = os.path.join(home_path, ".skratch")
|
sk_path = os.path.join(home_path, ".skratch")
|
||||||
make_dir(sk_path)
|
os.makedirs(sk_path, exist_ok=True)
|
||||||
|
|
||||||
parser = argparse.ArgumentParser(
|
parser = argparse.ArgumentParser(
|
||||||
prog='skratch',
|
prog='skratch',
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue