com web/rmtools: create build location if not exist: script/pecl.php script/snap.php
| From: | Anatol Belski | Date: | Sat, 13 May 2017 23:09:36 +0000 |
| Subject: | com web/rmtools: create build location if not exist: script/pecl.php script/snap.php | ||
| Groups: | php.webmaster | ||
| Request: | Send a blank email to php-webmaster+get-25870@lists.php.net to get a copy of this message | ||
Commit: cb78d10dde415b03bd93ea6b9c338d9986c0d20e
Author: Anatol Belski <ab@php.net> Sun, 14 May 2017 01:09:36 +0200
Parents: a652d1b4bf24a42840b559cb2d09fdcac2e36811
Branches: master
Link: http://git.php.net/?p=web/rmtools.git;a=commitdiff;h=cb78d10dde415b03bd93ea6b9c338d9986c0d20e
Log:
create build location if not exist
Changed paths:
M script/pecl.php
M script/snap.php
Diff:
diff --git a/script/pecl.php b/script/pecl.php
index d6b7f9d..f2ffd87 100644
--- a/script/pecl.php
+++ b/script/pecl.php
@@ -96,8 +96,10 @@ echo "Branch <$branch_name>" . PHP_EOL;
$build_dir_parent = $branch->config->getBuildLocation();
if (!is_dir($build_dir_parent)) {
- echo "Invalid build location <$build_dir_parent>" . PHP_EOL;
- exit(-1);
+ if !(mkdir($build_dir_parent, 0777, true)) {
+ echo "Couldn't create build location";
+ exit(-1);
+ }
}
$builds = $branch->getBuildList('windows');
diff --git a/script/snap.php b/script/snap.php
index 0f9a834..77fefd5 100644
--- a/script/snap.php
+++ b/script/snap.php
@@ -94,8 +94,10 @@ for ($i = 0; $i < count($builds_top) && ($force ||
$branch->hasNewRevision()); $
$build_dir_parent = $branch->config->getBuildLocation();
if (!is_dir($build_dir_parent)) {
- echo "Invalid build location <$build_dir_parent>\n";
- exit(-1);
+ if !(mkdir($build_dir_parent, 0777, true)) {
+ echo "Couldn't create build location";
+ exit(-1);
+ }
}
$toupload_dir = TMP_DIR . '/' . $branch_name . '/r' . $last_rev .
'-builds/';