$ws =
$this->
getWorkspaceDirectory();
$fs =
new SymfonyFilesystem();
if ($this->destroyBuild &&
$fs->
exists($ws)) { // Filter out symlinks as chmod cannot alter them.
$finder =
new Finder();
$finder->
in($ws) ->
directories() ->
ignoreVCS(FALSE
) ->
ignoreDotFiles(FALSE
) // composer script is a symlink and fails chmod. Ignore it.
->
notPath('/^vendor\/bin\/composer$/'
);
$fs->
chmod($finder->
getIterator(), 0775, 0000
);
$fs->
remove($ws);
} } /**
* Get the working directory within the workspace, creating if necessary.
*
* @param string $working_dir
* The path within the workspace directory.
*
* @return string
* The full path to the working directory within the workspace directory.
*/