From 653b713e79225aa9883e978308cfaaefb2575843 Mon Sep 17 00:00:00 2001 From: CiviCRM Date: Thu, 15 Mar 2018 23:06:29 +0000 Subject: [PATCH] set-version.php - Fix for running on uninitialized codebase The script assumes that `civicrm-version.php` is around. It will eventually be committed, and it's available if you ran GenCode, but it's not *necessarily* around yet. --- tools/bin/scripts/set-version.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/tools/bin/scripts/set-version.php b/tools/bin/scripts/set-version.php index e20f4a7fa9..711c196483 100755 --- a/tools/bin/scripts/set-version.php +++ b/tools/bin/scripts/set-version.php @@ -61,9 +61,11 @@ updateFile("xml/version.xml", function ($content) use ($newVersion, $oldVersion) return str_replace($oldVersion, $newVersion, $content); }); -updateFile("civicrm-version.php", function ($content) use ($newVersion, $oldVersion) { - return str_replace($oldVersion, $newVersion, $content); -}); +if (file_exists("civicrm-version.php")) { + updateFile("civicrm-version.php", function ($content) use ($newVersion, $oldVersion) { + return str_replace($oldVersion, $newVersion, $content); + }); +} updateFile("sql/civicrm_generated.mysql", function ($content) use ($newVersion, $oldVersion) { return str_replace($oldVersion, $newVersion, $content); -- 2.25.1