protected function generateFolders($type)
    {
        $slug = $this->data['slug'];

        if ($type == 'module') {
            $path = $this->packages->getModulesPath();

            $packagePath = $this->getModulePath($slug);

            $mode = 'module';
        } else if ($type == 'theme') {
            $path = $this->packages->getThemesPath();

            $packagePath = $this->getThemePath($slug);

            $mode = 'theme';
        } else {
            $path = $this->packages->getPackagesPath();

            $packagePath = $this->getPackagePath($slug);

            $mode = $this->option('extended') ? 'extended' : 'default';
        }

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

        $this->files->makeDirectory($packagePath);

        // Generate the Package directories.
        $packageFolders = $this->packageFolders[$mode];

        foreach ($packageFolders as $folder) {
            $path = $packagePath .$folder;

            $this->files->makeDirectory($path);
        }

        // Generate the Language inner directories.
        $languageFolders = $this->getLanguagePaths($slug, $type);

        foreach ($languageFolders as $folder) {
            $path = $packagePath .$folder;

            $this->files->makeDirectory($path);
        }
    }