Delete the deployment folder when everything is ready.
509684
async function deleteDeploymentFolder() {
  del.sync(deploymentTmpFolder, { force: true });
  del.sync(deploymentFolder, { force: true });
}
516219
def clear():
    
    utils.check_for_local_server()
    click.confirm(
        "Are you sure you want to do this? It will delete all of your data",
        abort=True
    )
    server = Server(config["local_server"]["url"])
    for db_name in all_dbs:
        del server[db_name]
328433
function remove()
    {
        $path = $this->path();
        if ( file_exists( $path ) )
        {
            eZDir::recursiveDelete( $path );
        }
        $this->setInstalled( false );
    }
172240
public function cleanTarget()
    {
        $filesystem = new Filesystem();

        // Get files and directories to remove
        $files = array_diff(scandir($this->target), ['.', '..']);
        $files = preg_grep('/[^.gitignore]/i', $files);

        // Remove files
        foreach ($files as $file) {
            $filesystem->remove("$this->target/$file");
        }

        // Fire event
        Event::fire('target.cleaned', [$this]);
    }
352344
def remove(self, dist):
        """"""
        while dist.location in self.paths:
            self.paths.remove(dist.location)
            self.dirty = True
        Environment.remove(self, dist)
876337
def cleanup_tmpdir(dirname):
    """"""
    if dirname is not None and os.path.exists(dirname):
        shutil.rmtree(dirname)
1114957
public function delete() : void
    {
        $files = $this->getFiles();
        foreach($files as $file) {
            $file->delete();
        }
        rmdir($this->path);
    }
503761
function (onComplete) {
            grunt.file.delete(options.tempDir, { force: true });

            fs.exists(options.downloadDestination, function (exists) {
                if (exists) {
                    fs.unlinkSync(options.downloadDestination);
                }

                if (onComplete) {
                    onComplete();
                }
            });
        }
929355
public function cleanup()
    {
        if ($this->isEnabled() && $this->hasPattern() && realpath($this->installDir)) {
            $paths = iterator_to_array($this->finder->in($this->installDir));

            /** @var \SplFileInfo $path */
            foreach ($paths as $path) {
                $this->filesystem->remove($path);
            }
        }
    }
650017
def cleanup(test_data, udfs, tmp_data, tmp_db):
    """"""
    con = make_ibis_client(ENV)

    if udfs:
        # this comes before test_data bc the latter clobbers this too
        con.hdfs.rmdir(os.path.join(ENV.test_data_dir, 'udf'))

    if test_data:
        con.drop_database(ENV.test_data_db, force=True)
        con.hdfs.rmdir(ENV.test_data_dir)

    if tmp_data:
        con.hdfs.rmdir(ENV.tmp_dir)

    if tmp_db:
        con.drop_database(ENV.tmp_db, force=True)
1221333
def clean_all(self, args):
        """"""
        self.clean_dists(args)
        self.clean_builds(args)
        self.clean_download_cache(args)
582661
protected function deletePastDeployments($past_deployments)
	{
		foreach ($past_deployments as $past_deployment)
		{
			$this->rollbackFiles($past_deployment['remote_host'], $past_deployment['remote_dir'], implode(' ', $past_deployment['dirs']));
		}
	}
549976
function clearDir()
    {
        $dir = _WWW.$this->patch.$this->id.'/';
        foreach (scandir($dir) as $file) {
            if ($file == '.' || $file == '..') {
                continue;
            }
            unlink($dir.$file);
        }
    }
1235820
def remove(self, auto_confirm=False, verbose=False):
        """"""

        if not self.paths:
            logger.info(
                "Can't uninstall '%s'. No files were found to uninstall.",
                self.dist.project_name,
            )
            return

        dist_name_version = (
            self.dist.project_name + "-" + self.dist.version
        )
        logger.info('Uninstalling %s:', dist_name_version)

        with indent_log():
            if auto_confirm or self._allowed_to_proceed(verbose):
                moved = self._moved_paths

                for_rename = compress_for_rename(self.paths)

                for path in sorted(compact(for_rename)):
                    moved.stash(path)
                    logger.debug('Removing file or directory %s', path)

                for pth in self.pth.values():
                    pth.remove()

                logger.info('Successfully uninstalled %s', dist_name_version)
107726
function cleanupFsStorage(conf) {
    if (conf.cleanupStartup) {
        const storagePath = conf.storage,
              files = fs.readdirSync(storagePath);

        files.forEach((file) => {
            try {
                const filePath = utils.filePath(file, storagePath);
                fs.removeSync(filePath, {force: true});
            } catch (err) {}
        });
    }
}
28493
public function cleanup()
	{
		$this->log('cleanup', LOG_DEBUG);

		$past_deployments = array();

		if (is_array($this->remote_host))
		{
			foreach ($this->remote_host as $remote_host)
			{
				if ($past_dirs = $this->collectPastDeployments($remote_host, $this->remote_dir))
				{
					$past_deployments[] = array(
						'remote_host' => $remote_host,
						'remote_dir' => $this->remote_dir,
						'dirs' => $past_dirs
					);
				}
			}
		}
		else
		{
			if ($past_dirs = $this->collectPastDeployments($this->remote_host, $this->remote_dir))
			{
				$past_deployments[] = array(
					'remote_host' => $this->remote_host,
					'remote_dir' => $this->remote_dir,
					'dirs' => $past_dirs
				);
			}
		}

		if (!empty($past_deployments)) {
			if (static::inputPrompt('Delete old directories? (yes/no): ', 'no') == 'yes')
				$this->deletePastDeployments($past_deployments);
		}
		else {
			$this->log('No cleanup needed');
		}
	}
1057343
protected function tearDown()
    {
        foreach ($this->purgePaths as $path) {
            if (file_exists($path)) {
                $this->purgePath($path);
            }
        }
    }