Write a specific support directory for the package.

@param  \Fly\Workbench\Package  $package
@param  string  $support
@param  string  $directory
@return void
496201
protected function writeSupportDirectory(Package $package, $support, $directory)
	{
		// Once we create the source directory, we will write an empty file to the
		// directory so that it will be kept in source control allowing the dev
		// to go ahead and push these components to Github right on creation.
		$path = $directory.'/src/'.$support;

		$this->files->makeDirectory($path, 0777, true);

		$this->files->put($path.'/.gitkeep', '');
	}
334105
protected function publishAssets($package)
    {
        if (! $this->dispatcher->hasNamespace($package)) {
            return $this->error('Package does not exist.');
        }

        if ( ! is_null($path = $this->getPath())) {
            $this->publisher->publish($package, $path);
        } else {
            $path = $this->dispatcher->getPackagePath($package);

            $this->publisher->publishPackage($package, $path);
        }

        $this->output->writeln('<info>Assets published for package:</info> ' .$package);
    }
35107
public function setPackage($package)
    {
        if ($package != $this->package) {
            $this->layoutLocation = null;
        }
        $this->package = $this->treatPackageName($package);
    }
1121997
protected function hasXliffFilesInDefaultDirectories(\TYPO3\Flow\Package\Package $package) {
		$packageBasePath = $package->getResourcesPath();
		$defaultLanguage = $this->settings['defaultLanguage'];

		if (is_dir($packageBasePath . 'Private/Translations')
			&& is_dir($packageBasePath . 'Private/Translations/' . $defaultLanguage)
			&& is_file($packageBasePath . 'Private/Translations/' . $defaultLanguage . '/Main.xlf')
		) {
			return true;
		}

		return false;
	}
901802
static function appendLicence( $package )
    {
        $package->appendDocument( 'LICENCE', false, false, false, true,
                                  "This file is part of the package " . $package->attribute( 'name' ) . ".\n" .
                                  "\n" .
                                  "This package is free software; you can redistribute it and/or modify\n" .
                                  "it under the terms of the GNU General Public License as published by\n" .
                                  "the Free Software Foundation; either version 2 of the License, or\n" .
                                  "(at your option) any later version.\n" .
                                  "\n" .
                                  "This package is distributed in the hope that it will be useful,\n" .
                                  "but WITHOUT ANY WARRANTY; without even the implied warranty of\n" .
                                  "MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n" .
                                  "GNU General Public License for more details.\n" .
                                  "\n" .
                                  "You should have received a copy of the GNU General Public License\n" .
                                  "along with this package; if not, write to the Free Software\n" .
                                  "Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA\n" );
    }
592497
protected function createPackageFolder($packagePath)
    {
        $this->info('Create package folder.');

        if (File::exists($packagePath)) {
            $this->info('Package folder already exists. Skipping.');

            return;
        }

        if (! File::makeDirectory($packagePath, 0755, true)) {
            throw new RuntimeException('Cannot create package folder');
        }

        $this->info('Package folder was successfully created.');
    }
1105403
private void writePackageInfos( File rootDir, File outputDir )
        throws MojoExecutionException
    {
        getLog().debug( "in writePackageInfos(" + rootDir + ", " + outputDir + ")" );

        try
        {
            if ( shouldWritePackageInfo( rootDir ) )
            {
                if( !outputDir.exists() && !outputDir.mkdirs() ) {
                    throw new MojoExecutionException( "outputDirectory was unable to be created: " + outputDir );
                }

                writePackageInfo( outputDir );
            }
            else
            {
                getLog().debug( "no files in:" + rootDir );
            }

        }
        catch ( Throwable e )
        {
            throw new MojoExecutionException( "could not write PackageInfo.java in: " + outputDir, e );
        }

        // get any sub-directories
        File[] subdirs = rootDir.listFiles( new FileFilter()
        {
            public boolean accept( File pathname )
            {
                return pathname.isDirectory();
            }
        } );

        // recurse
        if ( subdirs != null ) {
            for (File subdir : subdirs) {
                writePackageInfos(subdir, new File(outputDir, subdir.getName()));
            }
        }
    }
895088
protected function createClassDirectory(Package $package, $directory)
	{
		$path = $directory.'/src/'.$package->vendor.'/'.$package->name;

		if ( ! $this->files->isDirectory($path))
		{
			$this->files->makeDirectory($path, 0777, true);
		}

		return $path;
	}
155485
public function resetPackage(WritableRepositoryInterface $repository, PackageInterface $package)
    {
        $verbosityLevel = OutputUtils::resetVerbosity($this->appIO, OutputInterface::VERBOSITY_QUIET);

        $operation = new ResetOperation($package, 'Package reset due to changes in patches configuration');

        if (!$this->packageResetStrategy->shouldAllowReset($package)) {
            OutputUtils::resetVerbosity($this->appIO, $verbosityLevel);

            throw new \Vaimo\ComposerPatches\Exceptions\PackageResetException(
                sprintf('Package reset halted due to encountering local changes: %s', $package->getName())
            );
        }

        try {
            $this->installer->install($repository, $operation);
        } catch (\Exception $exception) {
            OutputUtils::resetVerbosity($this->appIO, $verbosityLevel);

            throw $exception;
        }

        OutputUtils::resetVerbosity($this->appIO, $verbosityLevel);
    }
193258
private function loadPackageTemplate($directory)
    {
        $namespacedPackageClass = $this->packageLoader->loadPackage(realpath($directory));
        $this->autoLoaderManager->mergePackageLoader(realpath($directory));
        $this->package = app($namespacedPackageClass);
    }
575816
public function setTemplatesDirectory($directory)
    {
        $this->templatesDirectory = rtrim($directory, DIRECTORY_SEPARATOR);
		$this->engine->setDirectory($this->getTemplatesDirectory());
    }
1202591
public function installPackageDir($package, $namespace, $packageAssetsDir)
    {
        $this->log($package->getTarget(), self::LOG_INFO, self::CODE_INSTALLING_DIR, array('namespace' => $namespace));
        if (!isset($this->assetsDirectories[$namespace])) {
            $this->log($package->getTarget(), self::LOG_WARNING, self::CODE_NO_MATCHING_DIR, array('namespace' => $namespace));
            $this->packagesStatuses[$package->getTarget()]['dirs'][$namespace]['status'] = 0;
            return;
        }
        $this->log($package->getTarget(), self::LOG_INFO, self::CODE_MATCHING_DIR, array('namespace' => $namespace));
        // We get the project vendor path
        $vendorPath = $this->getVendorPath();
        // We get the target dir of the iterated package
        $targetDir = $package->getTarget();
        // We get the full path of the current assets directory
        $packagePath = $vendorPath
            . $targetDir . "/" . $packageAssetsDir;
        // We check if this path is a directory
        if ($this->directoryHandler->isDirectory($packagePath)) {
            $this->log($package->getTarget(), self::LOG_INFO, self::CODE_DIRECTORY, array('directory' => $this->assetsDirectories[$namespace]));
            $src = $packagePath;
            $dst = $vendorPath . "../" . $this->assetsDirectories[$namespace] . $targetDir;
            // We delete the remaining directory if any
            // In order to update it
            $this->directoryHandler->deleteDirectory($dst);
            // We finally copy the package assets-dir
            // Into the project assets-dir
            $this->directoryHandler->copyDirectory($src, $dst);
            $this->log($package->getTarget(), self::LOG_INFO, self::CODE_DIR_INSTALLED, array('destination' => $dst));
            $this->packagesStatuses[$package->getTarget()]['dirs'][$namespace]['status'] = 1;
        } else {
            $this->log($package->getTarget(), self::LOG_ERROR, self::CODE_NOT_DIRECTORY, array('directory' => $this->assetsDirectories[$namespace]));
            $this->packagesStatuses[$package->getTarget()]['dirs'][$namespace]['status'] = 0;
        }
    }
739033
public function setPackage($package)
    {
        if ($package === $this->package) {
            return;
        }

        $this->package = $package;
        $this->packageOverridden = false;
    }
1221998
public static function autocreate_directory($directory)
    {
        if (!file_exists($directory)) {
            mkdir($directory, 0777, true);
        }

        if (!is_writable($directory)) {
            throw new \Exception("Directory \"{$directory}\" is not writable");
        }
    }
900586
private static function ensureDirectoryExists(FilePathInterface $directory): void
    {
        if (!is_dir($directory->__toString())) {
            mkdir($directory->__toString(), 0700, true);
        }
    }
1189824
public function addConfigComponent(string $package, string $namespace, string $path): void
    {
        if ($this->hasPackageRepository()) {
            $this->app->make('config')->package($package, $path, $namespace);
        }
    }
418053
public function publish($package, $source)
    {
        $destination = $this->publishPath .str_replace('/', DS, "/Packages/{$package}");

        $this->makeDestination($destination);

        return $this->files->copyDirectory($source, $destination);
    }