Ensure the component directories we need exist.

@return void
426323
protected function ensureComponentDirectoryExists()
    {
        if (! $this->filesystem->isDirectory(resource_path('assets/js/components'))) {
            $this->filesystem->makeDirectory(resource_path('assets/js/components'), 0755, true);
        }
    }
1018834
protected function setup_components() {
		$this->load_components();

		$components = $this->get_components();
		$this->set_component_parents( $components );
		/** @var \ComposePress\Core\Abstracts\Component[] $components */
		foreach ( $components as $component ) {
			if ( method_exists( $component, 'init' ) ) {
				$component->init();
			}
		}
	}
732374
function componentsHome(workdir) {
	var bowerrc = path.join(workdir, '.bowerrc'),
		defaultHome = path.join(workdir, 'bower_components');
	return (fs.existsSync(bowerrc) && require(bowerrc).directory) || defaultHome;
}
1066299
private function ensureDirectoryExists($path)
    {
        if (array_key_exists($path, $this->json)) {
            return;
        }

        // Recursively initialize parent directories
        if ('/' !== $path) {
            $this->ensureDirectoryExists(Path::getDirectory($path));
        }

        $this->json[$path] = null;
    }
944419
public static function autoload(): void
    {
        //  CI base helpers
        require_once BASEPATH . 'core/Common.php';

        $aComponents = [];
        foreach (Components::available() as $oModule) {
            $aComponents[] = (object) [
                'slug'     => $oModule->slug,
                'autoload' => $oModule->autoload,
            ];
        }

        //  Module items
        foreach ($aComponents as $oModule) {
            //  Helpers
            if (!empty($oModule->autoload->helpers)) {
                foreach ($oModule->autoload->helpers as $sHelper) {
                    if (is_array($sHelper)) {
                        list($sName, $sProvider) = $sHelper;
                        self::helper($sName, $sProvider);
                    } else {
                        self::helper($sHelper, $oModule->slug);
                    }
                }
            }
            //  Services
            if (!empty($oModule->autoload->services)) {
                foreach ($oModule->autoload->services as $sService) {
                    if (is_array($sHelper)) {
                        list($sName, $sProvider) = $sService;
                        self::service($sName, $sProvider);
                    } else {
                        self::service($sService, $oModule->slug);
                    }
                }
            }
        }
    }
772500
protected function createDirectories()
    {
        if (! is_dir(app_path('Http/Controllers/Teamwork'))) {
            mkdir(app_path('Http/Controllers/Teamwork'), 0755, true);
        }
        if (! is_dir(app_path('Listeners/Teamwork'))) {
            mkdir(app_path('Listeners/Teamwork'), 0755, true);
        }
        if (! is_dir(base_path('resources/views/teamwork'))) {
            mkdir(base_path('resources/views/teamwork'), 0755, true);
        }
        if (! is_dir(base_path('resources/views/teamwork/emails'))) {
            mkdir(base_path('resources/views/teamwork/emails'), 0755, true);
        }
        if (! is_dir(base_path('resources/views/teamwork/members'))) {
            mkdir(base_path('resources/views/teamwork/members'), 0755, true);
        }
    }
900314
public function setDirectory()
    {
        $pos = strrpos($this->dirPath, DIRECTORY_SEPARATOR);
        $this->directory = substr($this->dirPath, $pos + 1);
    }
441463
protected function setupUriRewrites()
    {
        foreach ($this->sources as $key => $source) {
            $file = $this->env->normalizePath($source->getFilePath());
            $minifyOptions = $source->getMinifierOptions();

            if ($file
                && !isset($minifyOptions['currentDir'])
                && !isset($minifyOptions['prependRelativePath'])) {
                $minifyOptions['currentDir'] = dirname($file);
                $source->setMinifierOptions($minifyOptions);
            }
        }
    }
801730
def ensure_dir_exists(directory):
    """"""
    if directory and not os.path.exists(directory):
        os.makedirs(directory)
199928
private function setupFolders()
    {
        $this->basePath = $this->kernelDir . '/config/bundles';
        $this->autoloadersPath = $this->basePath . '/autoloaders';
        $this->configPath = $this->basePath . '/config';
        $this->routingPath = $this->basePath . '/routing';
        $this->cachePath = $this->basePath . '/cache';

        $this->filesystem->mkdir(array(
            $this->basePath,
            $this->autoloadersPath,
            $this->configPath,
            $this->routingPath,
            $this->cachePath,));
    }
782377
public function setCompileDirectory()
    {
        $compilePath = $this->getTemplatesDirectory() . DIRECTORY_SEPARATOR . $this->compileDirectoryName . DIRECTORY_SEPARATOR;

        if (!file_exists($compilePath))
        {
            static::mkdir($compilePath);
        }

        $this->compilePath = $compilePath;
    }
464998
protected function ensureCacheDirectoryExists($path)
    {
        if (! $this->files->exists(dirname($path))) {
            $this->files->makeDirectory(dirname($path), 0777, true, true);
        }
    }
333717
public function generateFolders()
    {
        foreach ($this->getFolders() as $folder) {
            $path = $this->component->getComponentPath($this->getName()) . '/' . $folder;

            $this->filesystem->makeDirectory($path, 0755, true);

            $this->generateGitKeep($path);
        }
    }
1275303
private function includeAll()
    {
        $config = $this->readConfig();
        $files = array_merge(
            (array) $this->goals['include'],
            (array) $config['components']['include']
        );
        $this->includeGoals($files);
    }
467287
protected function createDirectoryStructure()
    {
        $this->output->writeLn("Ensuring correct directory structure.");

        $count = 0;
        foreach ($this->directoryStructure as $dir) {
            $label = $this->tree(++$count >= count($this->directoryStructure));
            if (!is_dir($dir)) {
                if (mkdir($dir)) {
                    $this->output->writeLn($label . $this->ok($dir));
                } else {
                    $this->output->writeLn($label . $this->fail($dir));
                    $this->flagFailing();
                }
            } else {
                $this->output->writeLn($label . $this->skip($dir));
            }
        }

        $this->nl();
    }
761474
protected function installFromFile()
    {
        if (!file_exists($path = base_path('components.json'))) {
            $this->error("File 'components.json' does not exist in your project root.");

            return;
        }

        $components = Json::make($path);

        $dependencies = $components->get('require', []);

        foreach ($dependencies as $component) {
            $component = collect($component);

            $this->install(
                $component->get('name'),
                $component->get('version'),
                $component->get('type')
            );
        }
    }
485389
protected function registerComponents()
    {
        ComponentManager::instance()->registerComponents(function ($manager) {
            $manager->registerComponent(\Cms\Components\ViewBag::class, 'viewBag');
            $manager->registerComponent(\Cms\Components\Resources::class, 'resources');
        });
    }