/** * Saves the given files in a temporary folder, copies them to the project root and deletes the temporary folder. * * @param File[] $files list of files to save. */ protected function save(array $files) { echo Line::begin('Saving generated files ...', Line::GREEN)->end(); foreach ($files as $file) { $file->save(); } echo Line::begin()->nl(); echo Line::begin('Copying generated files ...', Line::GREEN)->nl(); $fileList = $this->buildFileList($this->getTempPath(), $this->basePath); $this->copyFiles($fileList); echo Line::begin('Removing temporary files ...', Line::GREEN)->nl(); $this->removeDirectory($this->getTempPath()); }
/** * Renders the a text containing the current version of Caviar. * @return string the rendered text. */ protected function renderVersion() { return Line::begin('Caviar', Line::MAGENTA)->text('version')->text($this->version, Line::YELLOW)->nl(2); }
/** * */ public function renderErrors() { echo Line::begin('Errors:', 'red')->nl(); foreach ($this->getErrors() as $error) { echo Line::begin()->indent(2)->text('- ' . $error[0])->nl(); } exit(1); }