Skip to content

Commit

Permalink
check file existance before remove
Browse files Browse the repository at this point in the history
  • Loading branch information
cosven committed May 11, 2016
1 parent b167314 commit 9b48309
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions install.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ def generate_icon():
icon_string = '#!/usr/bin/env xdg-open\n'\
'[Desktop Entry]\n'\
'Type=Application\n'\
'Name=FeelUOwn-Dev\n'\
'Name=FeelUOwn\n'\
'Comment=FeelUOwn Launcher\n'\
'Exec=sh -c "PYTHONPATH={current_path}: python3 -m feeluown"\n'\
'Icon={feeluown_icon}\n'\
Expand All @@ -41,7 +41,8 @@ def generate_icon():
current_path=current_path)
f_path = os.path.expanduser('~') +\
'/.local/share/applications/FeelUOwn.desktop'
os.remove(f_path)
if os.path.exists(f_path):
os.remove(f_path)
with open(f_path, 'w') as f:
f.write(icon_string)
os.system('chmod +x %s' % f_path)
Expand Down

0 comments on commit 9b48309

Please sign in to comment.