blame优化

main
pengjunwu 2024-01-31 14:07:07 +08:00
parent 37f25ec7ff
commit 2fd00b9f54
1 changed files with 11 additions and 12 deletions

View File

@ -9,16 +9,14 @@ script_directory="$(cd "$(dirname "$0")" && pwd)"
text="$1"
#测试用
#text=" at UnityEditor.BuildPlayerWindow+DefaultBuildMethods.GetBuildPlayerOptions (UnityEditor.BuildPlayerOptions defaultBuildPlayerOptions) [0x00001] in /Volumes/jenkins1/sharedspace/ra_2022.3/Editor/Mono/BuildPlayerWindowBuildMethods.cs:209
# at BatchBuildBase.BuildContentAndPlayer () [0x000e9] in /Users/mayuanzheng/.jenkins/workspace/NLD_android_debug/ProjectNLD/Assets/PhxhSDK/Editor/BuildLauncherBase.cs:419
# at BatchBuild.BuildContentAndPlayer () [0x000f6] in /Users/mayuanzheng/.jenkins/workspace/NLD_android_debug/ProjectNLD/Assets/Editor/Common/BuildLauncher.cs:185
# UnityEngine.StackTraceUtility:ExtractStackTrace () (at /Volumes/jenkins1/sharedspace/ra_2022.3/Runtime/Export/Scripting/StackTrace.cs:37)
# UnityEngine.DebugLogHandler:LogFormat (UnityEngine.LogType,UnityEngine.Object,string,object[])
# UnityEngine.Logger:Log (UnityEngine.LogType,object)
# UnityEngine.Debug:LogError (object)
# BatchBuild:BuildContentAndPlayer () (at Assets/Editor/Common/BuildLauncher.cs:192)
#
# (Filename: Assets/Editor/Common/BuildLauncher.cs Line: 192)"
#text="[Licensing::Client] Error: HandshakeResponse reported an error:
# Assets/Code/Scripts/Gameplay/UI/Shop/UI_ShopController.cs(94,77): error CS0117: 'SDKManager.SdkName' does not contain a definition for 'IAP'
# Assets/Code/Scripts/Gameplay/UI/Shop/UI_ShopController.cs(94,85): error CS0246: The type or namespace name 'IBuyServices' could not be found (are you missing a using directive or an assembly reference?)
# Assets/Code/Scripts/Gameplay/UI/Shop/UI_ShopController.cs(94,77): error CS0117: 'SDKManager.SdkName' does not contain a definition for 'IAP'
# Assets/Code/Scripts/Gameplay/UI/Shop/UI_ShopController.cs(94,85): error CS0246: The type or namespace name 'IBuyServices' could not be found (are you missing a using directive or an assembly reference?)
# Assets/Code/Scripts/Gameplay/UI/Shop/UI_ShopController.cs(94,77): error CS0117: 'SDKManager.SdkName' does not contain a definition for 'IAP'
# Assets/Code/Scripts/Gameplay/UI/Shop/UI_ShopController.cs(94,85): error CS0246: The type or namespace name 'IBuyServices' could not be found (are you missing a using directive or an assembly reference?)
# Scripts have compiler errors."
echo "blame start $text"
@ -30,8 +28,9 @@ if [[ $text =~ (Assets\/[^:\(]+)\/([^:\(]+\.cs)[:\(]([0-9]+) ]]; then
echo "blame file: $fileName"
echo "blame line_num: $line_number"
cd ../../ProjectNLD/"$path" || exit
last_commit_author=$(git blame -L "$line_number" "$fileName" | awk '{print $2; exit}')
message="fileName:$path/$fileName \r\n line_num:$line_number \r\n author:${last_commit_author:1}"
#git blame -L "$line_number" "$fileName"
last_commit_author=$(git blame -L "$line_number" "$fileName" | sed 's/^[^(]*(\([^[:space:]]*\).*/\1/' | head -n 1)
message="fileName:$path/$fileName \r\n line_num:$line_number \r\n author:${last_commit_author}"
echo "message:$message"
cd "$script_directory" || exit
sh to_inner_wechat_robot.sh "$message"