fix ambiguous argument '../lib/const.rb' error (#8845)

* fix ambiguous argument '../lib/const.rb' error

* add more documentation
This commit is contained in:
Satadru Pramanik, DO, MPH, MEng
2023-10-29 12:20:31 -04:00
committed by GitHub
parent 9e8438824b
commit cff8eed1f2
2 changed files with 10 additions and 7 deletions

View File

@@ -1,8 +1,6 @@
# lib/const.rb
# Defines common constants used in different parts of crew
CREW_VERSION = '1.37.2'
CREW_CONST_GIT_COMMIT = `git log -n1 --oneline ../lib/const.rb`.chomp.split.first
CREW_VERSION = '1.37.3'
# kernel architecture
KERN_ARCH = `uname -m`.chomp
@@ -111,6 +109,11 @@ if repo_root.empty?
end
end
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_LOCAL_REPO_ROOT}/lib/const.rb`.chomp.split.first
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?
"#{CREW_LOCAL_REPO_ROOT}/manifest"

View File

@@ -126,14 +126,14 @@ pkg_update_arr.each do |pkg|
end
end
# Restart crew update if the git commit of ../lib/const.rb loaded in
# const.rb is different from the git commit of the potentially updated
# ../lib/const.rb loaded here after a git pull.
# Restart crew update if the git commit of const.rb loaded in const.rb
# is different from the git commit of the potentially updated const.rb
# loaded here after a git pull.
# 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 ../lib/const.rb`.chomp.split.first
@new_const_git_commit = `git log -n1 --oneline #{CREW_LOCAL_REPO_ROOT}/lib/const.rb`.chomp.split.first
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