Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

src: Delete unused code in uninstall.js #104

Merged
merged 3 commits into from
Dec 15, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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