forked from matiere-noire/roger
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathRoboFile.php
51 lines (35 loc) · 1.23 KB
/
RoboFile.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
<?php
use Symfony\Component\Finder\Finder;
class RoboFile extends \Robo\Tasks
{
public function build()
{
$pharTask = $this->taskPackPhar('roger.phar')
->compress()
->stub('stub.php');
$pharTask->addFile('index.php', 'index.php');
$finder = Finder::create()
->name('*.php')
->in('src');
foreach ($finder as $file) {
$pharTask->addFile('src/'.$file->getRelativePathname(), $file->getRealPath());
}
$this->_copyDir('files-to-copy/', "{$_SERVER['HOME']}/.roger/files-to-copy/" );
$finder = Finder::create()->files()
->name('*.php')
->in('vendor');
foreach ($finder as $file) {
$pharTask->addStripped('vendor/'.$file->getRelativePathname(), $file->getRealPath());
}
$finder = Finder::create()->files()
->name('*.php')
->name('*.md')
->in('files-to-copy');
foreach ($finder as $file) {
$pharTask->addStripped('files-to-copy/'.$file->getRelativePathname(), $file->getRealPath());
}
$pharTask->run();
// verify Phar is packed correctly
$code = $this->_exec('php roger.phar');
}
}