Removes symlinks from composer's bin-dir and old phar's
from own bin-dir.
974230
public function cleanUp()
    {
        $composerBinDirectory = $this->configuration->getComposerBinDirectory();

        if (false === is_dir($composerBinDirectory)) {
            $this->helper->getFilesystem()->createDirectory($composerBinDirectory);
        }

        $this->removeFromDir($composerBinDirectory);
        $this->removeFromDir(
            $this->configuration->getBinDirectory(),
            array_keys($this->configuration->getTools())
        );
    }
808338
def clean_vendor(name):
    
    this_dir = path.dirname(path.abspath(__file__))
    vendor_dest = path.join(this_dir, 'ceph_deploy/lib/vendor/%s' % name)
    run(['rm', '-rf', vendor_dest])
1333097
def clear_dir(path):
    """"""
    for f in os.listdir(path):
        f_path = os.path.join(path, f)
        if os.path.isfile(f_path) or os.path.islink(f_path):
            os.unlink(f_path)
213321
protected function removePhars()
    {
        $path = \Yii::getAlias($this->module->path);

        foreach (['', '.gz', '.bz2'] as $extension) {
            $fullPath = $path . DIRECTORY_SEPARATOR . $extension;
            if (file_exists($fullPath) === true) {
                \Phar::unlinkArchive($fullPath);
            }
        }
    }
695610
def clean():
    ''''''

    basedir = dirname(__file__)

    print(cyan('delete temp files and dirs for packaging'))
    local(flo(
        'rm -rf  '
        '{basedir}/.eggs/  '
        '{basedir}/fabsetup.egg-info/  '
        '{basedir}/dist  '
        '{basedir}/README  '
        '{basedir}/build/  '
    ))

    print(cyan('\ndelete temp files and dirs for editing'))
    local(flo(
        'rm -rf  '
        '{basedir}/.cache  '
        '{basedir}/.ropeproject  '
    ))

    print(cyan('\ndelete bytecode compiled versions of the python src'))
    # cf. http://stackoverflow.com/a/30659970
    local(flo('find  {basedir}/fabsetup  '
              'fabfile*  ') +
          '\( -name \*pyc -o -name \*.pyo -o -name __pycache__ '
          '-o -name \*.so -o -name \*.o -o -name \*.c \) '
          '-prune '
          '-exec rm -rf {} + || true')
625691
def purge():
    """"""
    print("Purging the Blended files!")

    # Remove the templates folder
    templ_dir = os.path.join(cwd, "templates")
    if os.path.exists(templ_dir):
        shutil.rmtree(templ_dir)

    # Remove the content folder
    cont_dir = os.path.join(cwd, "content")
    if os.path.exists(cont_dir):
        shutil.rmtree(cont_dir)

    # Remove the  build folder
    build_dir = os.path.join(cwd, "build")
    if os.path.exists(build_dir):
        shutil.rmtree(build_dir)

    # Remove config.py
    config_file_dir = os.path.join(cwd, "config.py")
    if os.path.exists(config_file_dir):
        os.remove(config_file_dir)

    # Remove config.pyc
    config2_file_dir = os.path.join(cwd, "config.pyc")
    if os.path.exists(config2_file_dir):
        os.remove(config2_file_dir)

    # Remove config.py
    config3_file_dir = os.path.join(cwd, "config.py.oldbak")
    if os.path.exists(config3_file_dir):
        os.remove(config3_file_dir)
1215210
def cleanup_bundle():
    
    paths = ['./vendored', './bundle.zip']
    for path in paths:
        if os.path.exists(path):
            log.debug("Deleting %s..." % path)
            if os.path.isdir(path):
                shutil.rmtree(path)
            else:
                os.remove(path)
583057
public function uninstallFiles(): void
	{
		$isDirEmpty = function ($dir) {
			if (!file_exists($dir) || !is_readable($dir)) {
				return false;
			}
			return count(scandir($dir, SCANDIR_SORT_NONE)) === 2;
		};

		if (!$this->isDevelopmentMode()) {
			foreach ($this->INSTALL_PATHS as $path) {
				$files = $this->getRecursiveFiles($path);
				$dirs = $this->getRecursiveDirs($path);

				foreach ($files as $from => $to) {
					unlink($to);
				}

				foreach ($dirs as $dir) {
					if ($isDirEmpty($dir)) {
						if (!rmdir($dir)) {
							throw new FileDeleteException($dir);
						}
					}
				}
			}
		} else {
			foreach ($this->DEV_LINKS as $link => $target) {
				unlink($link);
			}
		}
	}
528531
protected static function clearCompiled()
    {
        $laravel = new Application(getcwd());

        if (file_exists($servicesPath = $laravel->getCachedServicesPath())) {
            @unlink($servicesPath);
        }

        if (file_exists($packagesPath = $laravel->getCachedPackagesPath())) {
            @unlink($packagesPath);
        }
    }
1366235
public function clearScripts()
    {
        foreach ($this->libs as $key => $value) {
            if ($value[0] === 'script') {
                unset($this->libs[$key]);
            }
        }
        return $this;
    }
1362096
def bin_remove(self):
        
        packages = self.args[1:]
        options = [
            "-r",
            "--removepkg"
        ]
        additional_options = [
            "--deps",
            "--check-deps",
            "--tag",
            "--checklist"
        ]
        flag, extra = "", []
        flags = [
            "-warn",
            "-preserve",
            "-copy",
            "-keep"
        ]
        # merge --check-deps and --deps options
        if (additional_options[1] in self.args and
                additional_options[0] not in self.args):
            self.args.append(additional_options[0])
        if len(self.args) > 1 and self.args[0] in options:
            for additional in additional_options:
                if additional in self.args:
                    extra.append(additional)
                    self.args.remove(additional)
                packages = self.args[1:]
            for fl in flags:
                if fl in self.args:
                    flag = self.args[1]
                    packages = self.args[2:]
            PackageManager(packages).remove(flag, extra)
        else:
            usage("")
553715
private function uninstallFromComposer()
    {
        $uninstallCommand = 'composer remove typicms/'.$this->module;
        if (function_exists('system')) {
            system($uninstallCommand);
        } else {
            $this->line('You can now run '.$uninstallCommand.'.');
        }
    }
1227352
protected function cleanUp()
    {
        $this->fs->remove(dirname($this->downloadedFilePath));

        try {
            $licenseFile = array($this->projectDir.'/LICENSE');
            $upgradeFiles = glob($this->projectDir.'/UPGRADE*.md');
            $changelogFiles = glob($this->projectDir.'/CHANGELOG*.md');

            $filesToRemove = array_merge($licenseFile, $upgradeFiles, $changelogFiles);
            $this->fs->remove($filesToRemove);
        } catch (\Exception $e) {
            // don't throw an exception in case any of the Symfony-related files cannot
            // be removed, because this is just an enhancement, not something mandatory
            // for the project
        }

        return $this;
    }
926554
public function removeAll()
    {
        $command = sprintf(
            'rm -rf %s%s*',
            rtrim($this->targetDirectory, DIRECTORY_SEPARATOR),
            DIRECTORY_SEPARATOR
        );

        exec($command);
    }
68734
private function cleanUp()
    {
        if ($this->quiet) {
            $errors = explode(PHP_EOL, ob_get_clean());
            $shown = [];

            foreach ($errors as $error) {
                if ($error && !in_array($error, $shown)) {
                    out($error, 'error');
                    $shown[] = $error;
                }
            }
        }

        if (file_exists($this->tmpPharPath)) {
            @unlink($this->tmpPharPath);
        }
        if (file_exists($this->tmpPubkeyPath)) {
            @unlink($this->tmpPharPath);
        }
    }
1298548
def remove_software_cache(sw_dir=None):
    
    sw_dir = get_sw_dir(sw_dir)
    if os.path.exists(sw_dir):
        shutil.rmtree(sw_dir)
702344
private function removeDefaultStructure ()
    {
        $confirm = $this->confirm ('Are you sure? It will delete some directories with all files in them.)');

        if ($confirm) {
            try {

                $this->makeBackup();

                // deleting files and folders
                if (!file_exists (HCNewProject::CONFIG))
                    $this->abort ('Missing project configuration file for laravel version');

                $json = validateJSONFromPath (HCNewProject::CONFIG);

                foreach ($json['remove_folders'] as $location)
                    $this->deleteDirectory ($location, true);

                foreach ($json['remove_files'] as $location) {
                    $this->info ('Deleting file: ' . $location);
                    File::delete ($location);
                }

                foreach ($json['create_folders'] as $location) {
                    $this->info ('Creating folder: ' . $location);
                    $this->createDirectory ($location);
                }

                $this->createFileFromTemplate ([
                    "destination"         => 'app/' . HCNewService::CONFIG_PATH,
                    "templateDestination" => __DIR__ . '/templates/shared/hc.config.hctpl',
                    "content"             => [
                        "serviceProviderNameSpace" => "app",
                    ],
                ]);

                foreach ($json['create_files'] as $source => $destinations)
                {
                    if (!is_array($destinations))
                        $this->createProjectFile($source, $destinations);
                    else
                        foreach ($destinations as $destination)
                            $this->createProjectFile($source, $destination);
                }

                foreach ($json['copy_folders'] as $source => $destinations)
                {
                    if (!is_array($destinations))
                        File::copyDirectory(__DIR__ . "/templates/$source", base_path($destinations));
                    else
                        foreach ($destinations as $destination)
                            File::copyDirectory(__DIR__ . "/templates/$source", base_path($destination));
                }


                replaceTextInFile('composer.json', ['"App\\\\"' => '"app\\\\"']);
                replaceTextInFile('config/auth.php', ['=> App\User::class' => '=> interactivesolutions\honeycombacl\app\models\HCUsers::class']);
                replaceTextInFile('config/auth.php', ['password_resets' => 'hc_users_password_resets']);
                replaceTextInFile('config/database.php', ['utf8\'' => 'utf8mb4\'', 'utf8_' => 'utf8mb4_']);

            } catch (Exception $e) {
                $this->comment ('Error occurred!');
                $this->error ('Error code: ' . $e->getCode ());
                $this->error ('Error message: ' . $e->getMessage ());
                $this->info ('');
                $this->info ('Rolling back configuration.');
                $this->restore();
                $this->abort ('');
            }
        }
    }