mirror of
https://github.com/chromebrew/chromebrew.git
synced 2026-01-09 15:37:56 -05:00
crew: chdir before using git (#8859)
* chdir before using git * bump version * fix rubocop complaint
This commit is contained in:
committed by
GitHub
parent
81774bc89e
commit
1cbe12f2a9
@@ -1,6 +1,6 @@
|
||||
# lib/const.rb
|
||||
# Defines common constants used in different parts of crew
|
||||
CREW_VERSION = '1.37.7'
|
||||
CREW_VERSION = '1.37.8'
|
||||
|
||||
# kernel architecture
|
||||
KERN_ARCH = `uname -m`.chomp
|
||||
@@ -112,7 +112,10 @@ CREW_LOCAL_REPO_ROOT = repo_root
|
||||
|
||||
# The following is used in fixup.rb to determine if crew update needs to
|
||||
# be run again.
|
||||
CREW_CONST_GIT_COMMIT = `git log -n1 --oneline #{CREW_LIB_PATH}lib/const.rb`.chomp.split.first
|
||||
Dir.chdir CREW_LIB_PATH do
|
||||
@crew_const_git_commit = `git log -n1 --oneline #{CREW_LIB_PATH}lib/const.rb`.chomp.split.first
|
||||
end
|
||||
CREW_CONST_GIT_COMMIT = @crew_const_git_commit
|
||||
|
||||
CREW_LOCAL_REPO_BASE = CREW_LOCAL_REPO_ROOT.empty? ? '' : File.basename(CREW_LOCAL_REPO_ROOT)
|
||||
CREW_LOCAL_MANIFEST_PATH = if ENV['CREW_LOCAL_MANIFEST_PATH'].to_s.empty?
|
||||
|
||||
@@ -135,7 +135,9 @@ end
|
||||
# Handle case of const.rb not yet defining CREW_CONST_GIT_COMMIT.
|
||||
CREW_CONST_GIT_COMMIT = '0000' unless defined?(CREW_CONST_GIT_COMMIT)
|
||||
|
||||
@new_const_git_commit = `git log -n1 --oneline #{CREW_LIB_PATH}lib/const.rb`.chomp.split.first
|
||||
Dir.chdir CREW_LIB_PATH do
|
||||
@new_const_git_commit = `git log -n1 --oneline #{CREW_LIB_PATH}lib/const.rb`.chomp.split.first
|
||||
end
|
||||
|
||||
unless @new_const_git_commit.to_s == CREW_CONST_GIT_COMMIT.to_s
|
||||
puts 'Restarting crew update since there is an updated crew version.'.lightcyan
|
||||
|
||||
Reference in New Issue
Block a user