Skip to content

Commit

Permalink
Merge pull request #104 from pulsar-edit/cleanup-delete-unused-variable
Browse files Browse the repository at this point in the history
src: Delete unused code in uninstall.js
  • Loading branch information
confused-Techie authored Dec 15, 2023
2 parents 2ecd97f + 13a67c5 commit 571e2ca
Showing 1 changed file with 0 additions and 10 deletions.
10 changes: 0 additions & 10 deletions src/uninstall.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
const path = require('path');

const async = require('async');
const CSON = require('season');
const yargs = require('yargs');

const Command = require('./command');
Expand All @@ -27,14 +26,6 @@ Delete the installed package(s) from the ~/.pulsar/packages directory.\
return options.boolean('hard').describe('hard', 'Uninstall from ~/.pulsar/packages and ~/.pulsar/dev/packages');
}

getPackageVersion(packageDirectory) {
try {
return CSON.readFileSync(path.join(packageDirectory, 'package.json'))?.version;
} catch (error) {
return null;
}
}

async run(options) {
options = this.parseOptions(options.commandArgs);
const packageNames = this.packageNamesFromArgv(options.argv);
Expand All @@ -59,7 +50,6 @@ Delete the installed package(s) from the ~/.pulsar/packages directory.\
packageDirectory = path.join(packagesDirectory, packageName);
const packageManifestPath = path.join(packageDirectory, 'package.json');
if (fs.existsSync(packageManifestPath)) {
const packageVersion = this.getPackageVersion(packageDirectory);
fs.removeSync(packageDirectory);
} else if (!options.argv.hard) {
throw new Error(`No package.json found at ${packageManifestPath}`);
Expand Down

0 comments on commit 571e2ca

Please sign in to comment.