Skip to content

Instantly share code, notes, and snippets.

@stefpe
Last active January 21, 2019 13:34
Show Gist options
  • Save stefpe/022d07260ef7813bc00ecf305e964a0e to your computer and use it in GitHub Desktop.
Save stefpe/022d07260ef7813bc00ecf305e964a0e to your computer and use it in GitHub Desktop.
FilesystemStack
<?php
/**
* This is project's console commands configuration for Robo task runner.
*
* @see http://robo.li/
*/
class RoboFile extends \Robo\Tasks
{
/**
* Prepare file system structure.
* @return mixed
*/
public function prepareFs()
{
$collection = $this->collectionBuilder();
$collection->taskFilesystemStack()
->mkdir('g')
->touch('g/g.txt');
$collection->taskFilesystemStack()
->mkdir('g/h')
->touch('g/h/h.txt');
$collection->taskFilesystemStack()
->mkdir('g/h/i/c')
->touch('g/h/i/i.txt');
$collection->rollback(
$this->taskDeleteDir('g')
);
$collection->run();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment