51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
|
# File 'lib/docker-sync/upgrade_check.rb', line 51
def check_and_warn
if Gem::Version.new(last_upgraded_version) < Gem::Version.new('0.1.0')
Thor::Shell::Basic.new.say_status 'warning', 'Please be aware that with the strategy "unison" is now called unison-onesided and you might need to migrate. See https://github.com/EugenMayer/docker-sync/wiki/Migration-Guide for more informations', :red
unless Thor::Shell::Basic.new.yes?('Shall we continue? (y/N)')
exit 1
end
end
if Gem::Version.new(last_upgraded_version) < Gem::Version.new('0.2.0')
Thor::Shell::Basic.new.say_status 'warning', "A lot changed with 0.2.x! Unison is the default sync, unison-onesided has been REMOVED. If you have been using rsync, have been using unison excludes or you are not sure, please read the upgrade guide or your setup will go lala! : \n\n_Please_ read :): https://github.com/EugenMayer/docker-sync/wiki/1.2-Upgrade-Guide\n\n", :red
unless Thor::Shell::Basic.new.yes?('Shall we continue - DID you read it? (y/N)')
exit 1
end
end
if Gem::Version.new(last_upgraded_version) < Gem::Version.new('0.3.0')
Thor::Shell::Basic.new.say_status 'warning', "The installation progress of docker-sync 0.3.0 has changed, brew is now mandatory - you need to uninstall unox ! : \n\n_Please_ read :): https://github.com/EugenMayer/docker-sync/wiki/1.2-Upgrade-Guide\n\n", :red
cmd1 = 'sudo rm -f /usr/local/bin/unison-fsmonitor && brew tap eugenmayer/dockersync && brew install eugenmayer/dockersync/unox'
Thor::Shell::Basic.new.say_status 'ok', cmd1, :rwhite
if Thor::Shell::Basic.new.yes?('I will reinstall unox for you using the above command (y/N)')
system cmd1
else
raise('Please reinstall docker-sync yourself')
exit 1
end
end
if Gem::Version.new(last_upgraded_version) < Gem::Version.new('0.4.0')
Thor::Shell::Basic.new.say_status 'warning', "docker-sync has a new superior default sync strategy native_osx - consider switching to it no matter if you used unison or rsync. \nIt does no longer need Unison/Unox on OSX - no brew needed either. And its a lot thriftier ! \n\n_Please_ read :): https://github.com/EugenMayer/docker-sync/wiki/1.2-Upgrade-Guide\n\n", :red
unless Thor::Shell::Basic.new.yes?('Shall we continue - DID you read it - really :) ? (y/N)')
exit 1
end
end
@config.update! 'upgrade_status' => "#{UpgradeChecker.get_current_version}"
end
|