Skip to content

Commit

Permalink
fix: double quotes for metadata variables
Browse files Browse the repository at this point in the history
  • Loading branch information
alienc0der committed Sep 12, 2023
1 parent 4c01f92 commit 41a571d
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
10 changes: 5 additions & 5 deletions linux/create-git-metadata.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ GIT_COMMIT_FILE="../lib/utils/metadata.dart"

sed --i '1,5d' $GIT_COMMIT_FILE

echo "const String gitBranchName = '$GIT_BRANCH_NAME';" >> $GIT_COMMIT_FILE
echo "const String gitCommitHash = '$GIT_COMMIT_HASH';" >> $GIT_COMMIT_FILE
echo "const String gitCommitMessage = '$GIT_COMMIT_MESSAGE';" >> $GIT_COMMIT_FILE
echo "const String gitCommitDate = '$GIT_COMMIT_DATE';" >> $GIT_COMMIT_FILE
echo "const String gitOriginUrl = '$GIT_ORIGIN_URL';" >> $GIT_COMMIT_FILE
echo "const String gitBranchName = \\\"${GIT_BRANCH_NAME}\\\";" >> $GIT_COMMIT_FILE
echo "const String gitCommitHash = \\\"${GIT_COMMIT_HASH}\\\";" >> $GIT_COMMIT_FILE
echo "const String gitCommitMessage = \\\"${GIT_COMMIT_MESSAGE}\\\";" >> $GIT_COMMIT_FILE
echo "const String gitCommitDate = \\\"${GIT_COMMIT_DATE}\\\";" >> $GIT_COMMIT_FILE
echo "const String gitOriginUrl = \\\"${GIT_ORIGIN_URL}\\\";" >> $GIT_COMMIT_FILE
2 changes: 1 addition & 1 deletion macos/Runner.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,7 @@
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "GIT_BRANCH_NAME=$(git rev-parse --abbrev-ref HEAD)\nGIT_COMMIT_HASH=$(git rev-parse HEAD)\nGIT_COMMIT_MESSAGE=$(git log -1 --pretty=%s)\nGIT_COMMIT_DATE=$(git --no-pager log -1 --format=\"%ai\")\nGIT_ORIGIN_URL=$(git config --get remote.origin.url)\nGIT_COMMIT_FILE=\"../lib/utils/metadata.dart\"\n\nsed -i '' '1,5d' $GIT_COMMIT_FILE\necho \"const String gitBranchName = '$GIT_BRANCH_NAME';\" >> $GIT_COMMIT_FILE\necho \"const String gitCommitHash = '$GIT_COMMIT_HASH';\" >> $GIT_COMMIT_FILE\necho \"const String gitCommitMessage = '$GIT_COMMIT_MESSAGE';\" >> $GIT_COMMIT_FILE\necho \"const String gitCommitDate = '$GIT_COMMIT_DATE';\" >> $GIT_COMMIT_FILE\necho \"const String gitOriginUrl = '$GIT_ORIGIN_URL';\" >> $GIT_COMMIT_FILE\n\n\n";
shellScript = "GIT_BRANCH_NAME=$(git rev-parse --abbrev-ref HEAD)\nGIT_COMMIT_HASH=$(git rev-parse HEAD)\nGIT_COMMIT_MESSAGE=$(git log -1 --pretty=%s)\nGIT_COMMIT_DATE=$(git --no-pager log -1 --format=\"%ai\")\nGIT_ORIGIN_URL=$(git config --get remote.origin.url)\nGIT_COMMIT_FILE=\"../lib/utils/metadata.dart\"\n\nsed -i '' '1,5d' $GIT_COMMIT_FILE\necho \"const String gitBranchName = \\\"${GIT_BRANCH_NAME}\\\";\" >> $GIT_COMMIT_FILE\necho \"const String gitCommitHash = \\\"${GIT_COMMIT_HASH}\\\";\" >> $GIT_COMMIT_FILE\necho \"const String gitCommitMessage = \\\"${GIT_COMMIT_MESSAGE}\\\";\" >> $GIT_COMMIT_FILE\necho \"const String gitCommitDate = \\\"${GIT_COMMIT_DATE}\\\";\" >> $GIT_COMMIT_FILE\necho \"const String gitOriginUrl = \\\"${GIT_ORIGIN_URL}\\\";\" >> $GIT_COMMIT_FILE\n\n\n";
};
96DA24F0296EB70E00545E88 /* ShellScript */ = {
isa = PBXShellScriptBuildPhase;
Expand Down
10 changes: 5 additions & 5 deletions windows/CreateGitMetadata.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ $GIT_COMMIT_FILE = "${PSScriptRoot}\..\lib\utils\metadata.dart"

Clear-Content $GIT_COMMIT_FILE -Force

Add-Content $GIT_COMMIT_FILE "const String gitBranchName = '$GIT_BRANCH_NAME';"
Add-Content $GIT_COMMIT_FILE "const String gitCommitHash = '$GIT_COMMIT_HASH';"
Add-Content $GIT_COMMIT_FILE "const String gitCommitMessage = '$GIT_COMMIT_MESSAGE';"
Add-Content $GIT_COMMIT_FILE "const String gitCommitDate = '$GIT_COMMIT_DATE';"
Add-Content $GIT_COMMIT_FILE "const String gitOriginUrl = '$GIT_ORIGIN_URL';"
Add-Content $GIT_COMMIT_FILE "const String gitBranchName = `"${GIT_BRANCH_NAME}`";"
Add-Content $GIT_COMMIT_FILE "const String gitCommitHash = `"${GIT_COMMIT_HASH}`";"
Add-Content $GIT_COMMIT_FILE "const String gitCommitMessage = `"${GIT_COMMIT_MESSAGE}`";"
Add-Content $GIT_COMMIT_FILE "const String gitCommitDate = `"${GIT_COMMIT_DATE}`";"
Add-Content $GIT_COMMIT_FILE "const String gitOriginUrl = `"${GIT_ORIGIN_URL}`";"

0 comments on commit 41a571d

Please sign in to comment.