tagtime / TagTime

Stochastic Time Tracking for Space Cadets
http://tagti.me
Other
367 stars 51 forks source link

Install script is not idempotent #23

Open nomicode opened 11 years ago

nomicode commented 11 years ago

Choosing a new directory to install from (after having deleted an old directory) causes the install script to fail.

Steps to reproduce:

mkdir /tmp/a/ && cd /tmp/a
git clone https://github.com/dreeves/TagTime.git
cd TagTime && python install.py username
cd /tmp && rm -rf /tmp/a
mkdir /tmp/b && cd /tmp/b
git clone https://github.com/dreeves/TagTime.git
cd TagTime && python install.py username

What I see:

ln: /Users/nslater/.tagtimerc: File exists

What I expect to see:

Nothing.

nomicode commented 11 years ago

I believe the problem is this:

if os.path.isfile(symlink) :
   os.remove(symlink)

I think that isfile check is failing when the symlink is left dangling.