diff --git a/bin/crew b/bin/crew index 3fe7e71f6..9d7a62231 100755 --- a/bin/crew +++ b/bin/crew @@ -1924,8 +1924,7 @@ end load_json -@last_update_check = `stat -c %Y #{File.join(CREW_LIB_PATH, '.git/FETCH_HEAD')}`.chomp.to_i -@last_update_check = @last_update_check.blank? ? 0 : @last_update_check +@last_update_check = File.file?(File.join(CREW_LIB_PATH, '.git/FETCH_HEAD')) ? `stat -c %Y #{File.join(CREW_LIB_PATH, '.git/FETCH_HEAD')}`.chomp.to_i : `stat -c %Y #{File.join(CREW_LIB_PATH, 'lib/const.rb')}`.chomp.to_i crewlog("The last update was #{time_difference(@last_update_check, Time.now.to_i)} ago.") puts "It has been more than #{CREW_UPDATE_CHECK_INTERVAL} day#{CREW_UPDATE_CHECK_INTERVAL < 2 ? '' : 's'} since crew was last updated. Please run 'crew update'".lightpurple if Time.now.to_i - @last_update_check > (CREW_UPDATE_CHECK_INTERVAL * 3600 * 24) command_name = args.select { |k, v| v && command?(k) }.keys[0] diff --git a/lib/const.rb b/lib/const.rb index 6ddb1746b..6deba99e5 100644 --- a/lib/const.rb +++ b/lib/const.rb @@ -2,7 +2,7 @@ # Defines common constants used in different parts of crew require 'etc' -CREW_VERSION = '1.50.2' +CREW_VERSION = '1.50.3' # Kernel architecture. KERN_ARCH = Etc.uname[:machine]