all repos — dotfiles @ e493bbf94fac559fd69f6f70ef3fc8de3540ff91

linux dotfiles

update script/pd

pd does not change file if nothing was entered
Prithu Goswami prithugoswami524@gmail.com
Sat, 14 Apr 2018 23:45:45 +0530
commit

e493bbf94fac559fd69f6f70ef3fc8de3540ff91

parent

83df4ab7c4ad32206d4e9f93b855ef095e38bd2d

1 files changed, 4 insertions(+), 0 deletions(-)

jump to
M scripts/pdscripts/pd

@@ -15,6 +15,10 @@ with tempfile.NamedTemporaryFile(suffix='.pdtemp') as temp:

command = "vim {}".format(temp.name) subprocess.run(shlex.split(command)) entry = open(temp.name, 'r').read() + if entry == None: + print("Nothing was entered...") + exit() + with open(file_path, 'a', encoding='utf8') as fp: dt = datetime.datetime.now() date_string = dt.strftime('%a, %d %b %Y')