Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions scripts/common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -189,4 +189,5 @@ export CURRENT_DATETIME=`date +"%Y-%m-%d %H:%M:%S %z"`

git config --global --add safe.directory ${BASE_DIR}
export GIT_HASH=`git rev-parse HEAD`
export GIT_CURRENT_COMMIT_TIME=`git show -s --format=%ci HEAD`
Comment on lines 191 to +192
Copy link

Copilot AI Jun 12, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider using the $(...) command substitution syntax instead of backticks for improved readability and maintainability.

Suggested change
export GIT_HASH=`git rev-parse HEAD`
export GIT_CURRENT_COMMIT_TIME=`git show -s --format=%ci HEAD`
export GIT_HASH=$(git rev-parse HEAD)
export GIT_CURRENT_COMMIT_TIME=$(git show -s --format=%ci HEAD)

Copilot uses AI. Check for mistakes.

2 changes: 1 addition & 1 deletion scripts/teamcity/20.build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ source "$SCRIPT_DIR/../common.sh"
git config --global --add safe.directory '*'

sed -i -e 's/const GitHash string = .*/const GitHash string = "'${GIT_HASH}'"/' ${BASE_DIR}/meta/version.go
sed -i -e 's/const BuildTime string = .*/const BuildTime string = "'${CURRENT_DATETIME}'"/' ${BASE_DIR}/meta/version.go
sed -i -e 's/const BuildTime string = .*/const BuildTime string = "'${GIT_CURRENT_COMMIT_TIME}'"/' ${BASE_DIR}/meta/version.go
Copy link

Copilot AI Jun 12, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider ensuring that GIT_CURRENT_COMMIT_TIME is properly escaped for any special characters or spaces, to avoid issues during the sed substitution.

Suggested change
sed -i -e 's/const BuildTime string = .*/const BuildTime string = "'${GIT_CURRENT_COMMIT_TIME}'"/' ${BASE_DIR}/meta/version.go
ESCAPED_COMMIT_TIME=$(printf '%s' "${GIT_CURRENT_COMMIT_TIME}" | sed 's/[&/\]/\\&/g')
sed -i -e 's|const BuildTime string = .*|const BuildTime string = "'"${ESCAPED_COMMIT_TIME}"'"|' ${BASE_DIR}/meta/version.go

Copilot uses AI. Check for mistakes.
sed -i -e 's/const GoVersion string = .*/const GoVersion string = "'${GO_COMPILER_VERSION}'"/' ${BASE_DIR}/meta/version.go
sed -i -e 's/const Platform string = .*/const Platform string = "'${PLATFORM}'"/' ${BASE_DIR}/meta/version.go

Expand Down