Skip to content

Commit 04b4d22

Browse files
committed
Remove component version variables to ask them when copying files from github
1 parent 6417a8a commit 04b4d22

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

initializeBranch.sh

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,12 @@ function downloadGitHubFile {
2525
fi
2626
}
2727

28+
function removeComponentVersionVariables {
29+
sed -i "/readonly PHPBENCHMARKS_DEPENDENCY_MAJOR_VERSION=/d" "$INSTALLATION_PATH/.phpbenchmarks/configuration.sh"
30+
sed -i "/readonly PHPBENCHMARKS_DEPENDENCY_MINOR_VERSION=/d" "$INSTALLATION_PATH/.phpbenchmarks/configuration.sh"
31+
sed -i "/readonly PHPBENCHMARKS_DEPENDENCY_BUGFIX_VERSION=/d" "$INSTALLATION_PATH/.phpbenchmarks/configuration.sh"
32+
}
33+
2834
function downloadFilesFromGithub {
2935
echoAsk "Component slug to copy? (Example: symfony, laravel, cake-php)" false
3036
read slugToCopy
@@ -35,7 +41,7 @@ function downloadFilesFromGithub {
3541
readonly GITHUB_BRANCH="$slugToCopy"_"$versionToCopy"_"$RESULT_TYPE_SLUG"
3642
echoValidationGroupStart "Downloading files from https://github.com/phpbenchmarks/$slugToCopy/tree/$GITHUB_BRANCH"
3743
downloadGitHubFile ".phpbenchmarks/configuration.sh"
38-
echoValidationWarning "Configuration has been copied from another version. Don't forget to edit .phpbenchmarks/configuration.sh."
44+
removeComponentVersionVariables
3945
downloadGitHubFile ".phpbenchmarks/initBenchmark.sh"
4046
downloadGitHubFile ".phpbenchmarks/vhost.conf"
4147
source $RESULT_TYPE_PATH/downloadFilesFromGithub.sh
@@ -140,6 +146,8 @@ function createConfigurationFile {
140146
defineVariableInConfigurationFile "PHPBENCHMARKS_DEPENDENCY_MINOR_VERSION" "$PHPBENCHMARKS_DEPENDENCY_MINOR_VERSION" false
141147
defineVariableInConfigurationFile "PHPBENCHMARKS_DEPENDENCY_BUGFIX_VERSION" "$PHPBENCHMARKS_DEPENDENCY_BUGFIX_VERSION" false
142148

149+
source "$configurationFilePath" &>/dev/null
150+
143151
echoValidationGroupEnd
144152
}
145153

0 commit comments

Comments
 (0)