Skip to content

Commit

Permalink
Check if file exists before copy
Browse files Browse the repository at this point in the history
  • Loading branch information
jarun committed May 2, 2020
1 parent 2da9086 commit 5b7f806
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
#!/usr/bin/env python3

import re
import os.path
import setuptools
import shutil

shutil.copyfile('ddgr', 'ddgr.py')
if os.path.isfile('ddgr'):
shutil.copyfile('ddgr', 'ddgr.py')

with open('ddgr.py', encoding='utf-8') as fp:
version = re.search(r'_VERSION_ = \'(.*?)\'', fp.read()).group(1)
Expand Down

0 comments on commit 5b7f806

Please sign in to comment.