Skip to content

Commit

Permalink
Fix build task in the robo file to ignore some files
Browse files Browse the repository at this point in the history
  • Loading branch information
Anderson Grudtner Martins committed May 22, 2017
1 parent 6bd2e31 commit a40a171
Showing 1 changed file with 23 additions and 9 deletions.
32 changes: 23 additions & 9 deletions RoboFile.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class RoboFile extends \Robo\Tasks
const PACKAGE_PATH = 'packages';

const PLUGIN_SLUG = 'publishpress';

const PROPERTIES_FILE_PATH = __DIR__ . '/.properties.ini';

protected $options = array();
Expand Down Expand Up @@ -72,17 +72,31 @@ public function packBuild($destination = null)
$packPath = self::PACKAGE_PATH . '/'. $filename;
$pack = $this->taskPack($packPath);

// Remove existent package
if (file_exists($packPath)) {
unlink($packPath);
}

$srcContent = scandir(self::SOURCE_PATH);
foreach ($srcContent as $content) {
if (! in_array($content, array('.', '..'))) {
$ignore = array(
'.',
'..',
'build',
'tests',
'.git',
'.gitignore',
'README',
'.DS_Store',
);

if (! in_array($content, $ignore)) {
$path = self::SOURCE_PATH . '/' . $content;

if ($content !== 'node_modules') {
if (is_file($path)) {
$pack->addFile($content, $path);
} else {
$pack->addDir($content, $path);
}
if (is_file($path)) {
$pack->addFile($content, $path);
} else {
$pack->addDir($content, $path);
}
}
}
Expand Down Expand Up @@ -252,7 +266,7 @@ public function syncSrc()
public function syncSvnTag($tag)
{
$properties = $this->getProperties();

$this->_exec('cd ' . $properties['svn_path'] . ' && svn update');
$this->_exec('cd ' . $properties['svn_path'] . ' && cp -r ' . realpath(__DIR__) . '/' . self::SOURCE_PATH . '/* ' . $properties['svn_path'] . '/trunk');
$this->_exec('cd ' . $properties['svn_path'] . ' && svn cp trunk tags/' . $tag);
Expand Down

0 comments on commit a40a171

Please sign in to comment.