Skip to content

Commit 5205dbd

Browse files
committed
Do not traverse parent directories when looking up deploy file
1 parent 0317c61 commit 5205dbd

1 file changed

Lines changed: 2 additions & 9 deletions

File tree

bin/dep

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -32,15 +32,8 @@ if (!empty($deployFile)) {
3232
$deployFile = realpath($deployFile);
3333
}
3434
$lookUp = function (string $name): ?string {
35-
$dir = getcwd();
36-
for ($i = 0; $i < 10; $i++) {
37-
$path = "$dir/$name";
38-
if (is_readable($path)) {
39-
return $path;
40-
}
41-
$dir = dirname($dir);
42-
}
43-
return '';
35+
$path = getcwd() . '/' . $name;
36+
return is_readable($path) ? $path : null;
4437
};
4538
if (empty($deployFile)) {
4639
$deployFile = $lookUp('deploy.php');

0 commit comments

Comments
 (0)