Before the installation we remove the metadata in order to refresh them correctly during the installation process. This causes issues when the installation fails.
Actions taken
instead of removing the metadata folder we rename it and then delete that backup only if the installation succeeds
when there is an Error or the system command returns false (unsuccessful), we restore the backed up metadata folder so that brew doesn't lose track of the installed cask
Fixes #149
Description
Before the installation we remove the metadata in order to refresh them correctly during the installation process. This causes issues when the installation fails.
Actions taken
Error
or the system command returns false (unsuccessful), we restore the backed up metadata folder so thatbrew
doesn't lose track of the installed cask