xsnrg / OpenHAB2-tools

various scripts and hacks to assist with OpenHAB2
19 stars 7 forks source link

fix delete old habmin #1

Closed marcelrv closed 8 years ago

xsnrg commented 8 years ago

Thanks for the request! The purpose of the line is to remove the prior version of 2.0, as Chris tends to name them like org.openhab.ui.habmin_2.0.0.SNAPSHOT-0.1.6.jar where the part that changes is usually the 0.1.6 part. I had not thought about 1.x being installed with OpenHAB 2.0 anymore. I would suggest changing it to not care about the version, and just delete any version of Habmin it finds, making the line

rm $HAB/addons/org.openhab.ui.habmin_*

Thoughts?

marcelrv commented 8 years ago

That will work better indeed. Or even make it sweeter with a test, so script wont die if the file is not found. something like

if [ -f $HAB/addons/org.openhab.ui.habmin* ] then rm $HAB/addons/org.openhab.ui.habmin* fi

xsnrg commented 8 years ago

or we just add a -f to the rm, which fails silently. Your last idea is perhaps more elegant though. If you want to change the PR, I'll merge it.

Thanks

marcelrv commented 8 years ago

superseeded by https://github.com/xsnrg/OpenHAB2-tools/pull/2