Removes the package-lock.json file from .gitignore, because we don't want the package-lock.json to be included in
our repositories, but they should be included when developing specific project.
551766
public static function removePackageLockJsonFromGitIgnore()
    {
        if (!file_exists(static::GIT_IGNORE_FILE)) {
            return;
        }

        $gitignore = file_get_contents(static::GIT_IGNORE_FILE);
        $gitignore = str_replace("package-lock.json\n", '', $gitignore);
        file_put_contents(static::GIT_IGNORE_FILE, $gitignore);
    }
442932
def _uninstall(
    action='remove',
    name=None,
    version=None,
    pkgs=None,
    normalize=True,
    ignore_epoch=False,
    **kwargs):
    '''
    
    '''
    if action not in ('remove', 'purge'):
        return {'name': name,
                'changes': {},
                'result': False,
                'comment': 'Invalid action \'{0}\'. '
                           'This is probably a bug.'.format(action)}

    try:
        pkg_params = __salt__['pkg_resource.parse_targets'](
            name,
            pkgs,
            normalize=normalize)[0]
    except MinionError as exc:
        return {'name': name,
                'changes': {},
                'result': False,
                'comment': 'An error was encountered while parsing targets: '
                           '{0}'.format(exc)}
    targets = _find_remove_targets(name, version, pkgs, normalize,
                                   ignore_epoch=ignore_epoch, **kwargs)
    if isinstance(targets, dict) and 'result' in targets:
        return targets
    elif not isinstance(targets, list):
        return {'name': name,
                'changes': {},
                'result': False,
                'comment': 'An error was encountered while checking targets: '
                           '{0}'.format(targets)}
    if action == 'purge':
        old_removed = __salt__['pkg.list_pkgs'](versions_as_list=True,
                                                removed=True,
                                                **kwargs)
        targets.extend([x for x in pkg_params if x in old_removed])
    targets.sort()

    if not targets:
        return {'name': name,
                'changes': {},
                'result': True,
                'comment': 'None of the targeted packages are installed'
                           '{0}'.format(' or partially installed'
                                        if action == 'purge' else '')}

    if __opts__['test']:
        return {'name': name,
                'changes': {},
                'result': None,
                'comment': 'The following packages will be {0}d: '
                           '{1}.'.format(action, ', '.join(targets))}

    changes = __salt__['pkg.{0}'.format(action)](name, pkgs=pkgs, version=version, **kwargs)
    new = __salt__['pkg.list_pkgs'](versions_as_list=True, **kwargs)
    failed = []
    for x in pkg_params:
        if __grains__['os_family'] in ['Suse', 'RedHat']:
            # Check if the package version set to be removed is actually removed:
            if x in new and not pkg_params[x]:
                failed.append(x)
            elif x in new and pkg_params[x] in new[x]:
                failed.append(x + "-" + pkg_params[x])
        elif x in new:
            failed.append(x)

    if action == 'purge':
        new_removed = __salt__['pkg.list_pkgs'](versions_as_list=True,
                                                removed=True,
                                                **kwargs)
        failed.extend([x for x in pkg_params if x in new_removed])
    failed.sort()

    if failed:
        return {'name': name,
                'changes': changes,
                'result': False,
                'comment': 'The following packages failed to {0}: '
                           '{1}.'.format(action, ', '.join(failed))}

    comments = []
    not_installed = sorted([x for x in pkg_params if x not in targets])
    if not_installed:
        comments.append('The following packages were not installed: '
                        '{0}'.format(', '.join(not_installed)))
        comments.append('The following packages were {0}d: '
                        '{1}.'.format(action, ', '.join(targets)))
    else:
        comments.append('All targeted packages were {0}d.'.format(action))

    return {'name': name,
            'changes': changes,
            'result': True,
            'comment': ' '.join(comments)}
557866
public function unfreezePackageReflection($packageKey)
    {
        if (!$this->initialized) {
            $this->initialize();
        }
        $pathAndFilename = $this->getPrecompiledReflectionStoragePath() . $packageKey . '.dat';
        if (file_exists($pathAndFilename)) {
            unlink($pathAndFilename);
        }
    }
427308
def remove_release(self, username, package_name, version):
        '''
        
        '''
        url = '%s/release/%s/%s/%s' % (self.domain, username, package_name, version)
        res = self.session.delete(url)
        self._check_response(res, [201])
        return
175922
function cleanPkgDistDirs() {
  const statuses = globSync('packages/*/dist').map(
    (distPath) => spawnSync('rm', ['-r', distPath], {stdio: 'inherit'}).status);

  if (statuses.find((status) => status > 0)) {
    console.error('Failed to clean package dist folders prior to copying');
    process.exit(1);
  }
}
1288940
def cleanDir(self):
        '''  '''
        if os.path.isdir(self.outdir):
            baddies = ['tout.json','nout.json','hout.json']
            for file in baddies:
                filepath = os.path.join(self.outdir,file)
                if os.path.isfile(filepath):
                    os.remove(filepath)
1160933
def remove_file(path, conn=None):
    '''
    
    '''
    if conn is None:
        conn = init()

    log.debug('Removing package file %s', path)
    os.remove(path)
205810
private void removeTaskFromBomFile(File buildGradleTmp) {
        FileReader fileReader;
        BufferedReader bufferedReader = null;
        try {
            fileReader = new FileReader(buildGradleTmp);
            bufferedReader = new BufferedReader(fileReader);
            String currLine;
            String originalLines = "";
            while ((currLine = bufferedReader.readLine()) != null) {
                if (currLine.equals(TASK_COPY_DEPENDENCIES_HEADER)) {
                    break;
                } else {
                    originalLines = originalLines.concat(currLine + Constants.NEW_LINE);
                }
            }
            if (!originalLines.isEmpty()) {
                byte[] bytes = originalLines.getBytes();
                Files.write(Paths.get(buildGradleTmp.getPath()), bytes, StandardOpenOption.WRITE, StandardOpenOption.TRUNCATE_EXISTING);
            }
        } catch (IOException e) {
            logger.warn("Couldn't remove 'copyDependencies' task from {}, error: {}", buildGradleTmp.getPath(), e.getMessage());
            logger.debug("Error: {}", e.getStackTrace());
        } finally {
            try {
                if (bufferedReader != null) {
                    bufferedReader.close();
                }
            } catch (IOException e) {
                logger.error("Could close the file, cause", e.getMessage());
            }
        }
    }
89422
public static void cleanup(String repoPath) throws GitAPIException, IOException {
        openRepository(new File(repoPath)).gc().call();
    }
362619
function(cb) {
            var lockFile = path.join(repoDir, '.git', 'index.lock');
            path.exists(lockFile, function(exists) {
                if (exists) {
                    fs.unlink(lockFile, function(err) {
                        if (err) {
                            log.warn('removing file ' + lockFile + ' failed with:', err);
                        }
                        else {
                            log.info('removed lock file: ' + lockFile);
                        }
                        cb(err, {removelock: 'remove git lock ' + lockFile + ', result ' + err});
                    });
                    return;
                }
                log.log('There is no lock file left, which is a good thing');
                cb(null, {removelock: 'no lock was present'});
            });
        }
311023
public function uninstall(\Composer\Repository\InstalledRepositoryInterface $repo, \Composer\Package\PackageInterface $package) {
		$this->moveBackResources($package);
		
		parent::uninstall($repo, $package);
	}
1131162
def remove(self):
        
        logger.debug("")

        rd = self.repo_dir

        logger.debug("pkg path %s", rd)
        if not rd:
            print(
                "unable to find pkg '%s'. %s" % (self.name, did_u_mean(self.name))
            )
            return

        # Does the repo have any uncommitted changes?
        # Is the repo out of sync(needs a push?)

        # Are you sure?
        resp = input(self.term.red("Are you sure you want to remove the '%s' pkg? [y|N] " %
                                   self.name))

        if resp == 'y' or resp == 'yes':
            self.pr_atten('removing {}...', self.name)
            shutil.rmtree(rd)
1281497
def uninstall(pkg):
    '''
    
    '''
    ret = {'result': None, 'output': ''}

    out = __salt__['cmd.run_all'](FLATPAK_BINARY_NAME + ' uninstall ' + pkg)

    if out['retcode'] and out['stderr']:
        ret['stderr'] = out['stderr'].strip()
        ret['result'] = False
    else:
        ret['stdout'] = out['stdout'].strip()
        ret['result'] = True

    return ret
329285
public function uninstall_cleanup() {
        global $CFG;
        require_once($CFG->dirroot.'/repository/lib.php');

        $repo = \repository::get_type_by_typename($this->name);
        if ($repo) {
            $repo->delete(true);
        }

        parent::uninstall_cleanup();
    }
1079468
function cleanUpOldExecutable(next) {
        fs.unlink(nodeCompiler.releasePath, function(err) {
          if (err) {
            if (err.code === 'ENOENT') {
              next();
            } else {
              throw err;
            }
          } else {
            next();
          }
        });
      }
1167025
private function removeCachedPemFile()
    {
        $fs = new Filesystem();
        $filename = $this->cachedir . self::APNS_CERTIFICATE_FILE;
        if ($fs->exists(dirname($filename))) {
            $fs->remove(dirname($filename));
        }
    }
1202208
function copy(from, to) {
		var mode = fs.statSync(from).mode;
		var src = fs.readFileSync(from, 'utf8');

		var re = /%([0-9A-Z\_]+)%/g;

		function replacer(_, match) {
			// We support the %PERIOD% variable to allow .gitignore to be created. The reason:
			// npm "kindly" ignores .gitignore files, so we have to use this workaround.
			// More info: https://github.com/isaacs/npm/issues/2958

			if (match === 'PERIOD') {
				return '.';
			}

			return templateRules.replace(match);
		}

		try {
			to = to.replace(re, replacer);
			src = src.replace(re, replacer);
		} catch (error) {
			pretty.warning(error + ' in: ' + from);

			// skip this file
			return;
		}

		var fd = fs.openSync(to, 'w', mode);
		fs.writeSync(fd, src);
		fs.closeSync(fd);
	}