Skip to content

Commit 7bedb9a

Browse files
Ensure that php code sniffer is not included in robo.phar. Allow Rsync::fromPath() to take an array of paths, and make phar:build rsync using a whitelist instead of a blacklist.
1 parent f8421b2 commit 7bedb9a

File tree

3 files changed

+99
-104
lines changed

3 files changed

+99
-104
lines changed

RoboFile.php

+7-14
Original file line numberDiff line numberDiff line change
@@ -270,23 +270,16 @@ public function pharBuild()
270270
->taskFilesystemStack()
271271
->mkdir($workDir)
272272
->taskRsync()
273-
->fromPath(__DIR__ . '/')
274-
->toPath($roboBuildDir)
275-
->recursive()
276-
->exclude(
273+
->fromPath(
277274
[
278-
'vendor/',
279-
'.idea/',
280-
'build',
281-
'site/',
282-
'robotheme/',
283-
'tests/_log',
284-
'tests/_helpers/_generated',
285-
'composer.phar',
286-
'composer.lock',
287-
'robo.phar',
275+
__DIR__ . '/composer.json',
276+
__DIR__ . '/scripts',
277+
__DIR__ . '/src',
278+
__DIR__ . '/data'
288279
]
289280
)
281+
->toPath($roboBuildDir)
282+
->recursive()
290283
->progress()
291284
->stats()
292285
->taskComposerRemove()

composer.lock

+85-85
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/Task/Remote/Rsync.php

+7-5
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ public function __construct()
106106
* This can either be a full rsync path spec (user@host:path) or just a path.
107107
* In case of the former do not specify host and user.
108108
*
109-
* @param string $path
109+
* @param string|array $path
110110
*
111111
* @return $this
112112
*/
@@ -445,18 +445,20 @@ public function run()
445445
*/
446446
public function getCommand()
447447
{
448-
$this->option(null, $this->getFromPathSpec())
449-
->option(null, $this->getToPathSpec());
448+
foreach ((array)$this->fromPath as $from) {
449+
$this->option(null, $this->getFromPathSpec($from));
450+
}
451+
$this->option(null, $this->getToPathSpec());
450452

451453
return $this->command . $this->arguments;
452454
}
453455

454456
/**
455457
* @return string
456458
*/
457-
protected function getFromPathSpec()
459+
protected function getFromPathSpec($from)
458460
{
459-
return $this->getPathSpec($this->fromHost, $this->fromUser, $this->fromPath);
461+
return $this->getPathSpec($this->fromHost, $this->fromUser, $from);
460462
}
461463

462464
/**

0 commit comments

Comments
 (0)