Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@oclif/plugin-update

Package Overview
Dependencies
Maintainers
2
Versions
204
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@oclif/plugin-update - npm Package Compare versions

Comparing version 4.5.10 to 4.6.0

1

dist/commands/update.d.ts

@@ -16,2 +16,3 @@ import { Command, Interfaces } from '@oclif/core';

interactive: Interfaces.BooleanFlag<boolean>;
verbose: Interfaces.BooleanFlag<boolean>;
version: Interfaces.OptionFlag<string | undefined, Interfaces.CustomOptions>;

@@ -18,0 +19,0 @@ };

48

dist/commands/update.js
import select from '@inquirer/select';
import { Args, Command, Flags, ux } from '@oclif/core';
import { printTable } from '@oclif/table';
import { got } from 'got';
import { basename } from 'node:path';
import { sort } from 'semver';
import TtyTable from 'tty-table';
import { Updater } from '../update.js';

@@ -47,2 +47,7 @@ export default class UpdateCommand extends Command {

}),
verbose: Flags.boolean({
char: 'b',
dependsOn: ['available'],
description: 'Show more details about the available versions.',
}),
version: Flags.string({

@@ -59,20 +64,27 @@ char: 'v',

const { distTags, index, localVersions } = await lookupVersions(updater, this.config);
const headers = [
{ align: 'left', value: 'Location' },
{ align: 'left', value: 'Version' },
];
if (distTags) {
headers.push({ align: 'left', value: 'Channel' });
}
// eslint-disable-next-line new-cap
const t = TtyTable(headers, sort(Object.keys(index))
.reverse()
.map((version) => {
const data = Object.keys(index).map((version) => {
const location = localVersions.find((l) => basename(l).startsWith(version)) || index[version];
if (distTags) {
return [location, version, distTags[version] ?? ''];
}
return [location, version];
}), { compact: true });
ux.stdout(t.render());
const channel = distTags[version] === 'latest'
? 'stable'
: distTags[version] === 'latest-rc'
? 'stable-rc'
: distTags[version];
return {
channel,
downloaded: location.includes('http') ? '' : 'true',
location,
version: this.config.version === version ? `${ux.colorize('yellowBright', version)} (current)` : version,
};
});
printTable({
borderStyle: 'vertical-with-outline',
columns: flags.verbose
? ['version', 'channel', 'downloaded', 'location']
: ['version', 'channel', 'downloaded'],
data,
headerOptions: {
formatter: 'capitalCase',
},
overflow: 'wrap',
});
return;

@@ -79,0 +91,0 @@ }

@@ -168,3 +168,3 @@ import { Config, ux } from '@oclif/core';

async refreshConfig(version) {
this.config = (await Config.load({ root: join(this.clientRoot, version) }));
this.config = await Config.load({ root: join(this.clientRoot, version) });
}

@@ -171,0 +171,0 @@ // removes any unused CLIs

@@ -67,2 +67,12 @@ {

},
"verbose": {
"char": "b",
"dependsOn": [
"available"
],
"description": "Show more details about the available versions.",
"name": "verbose",
"allowNo": false,
"type": "boolean"
},
"version": {

@@ -100,3 +110,3 @@ "char": "v",

},
"version": "4.5.10"
"version": "4.6.0"
}
{
"name": "@oclif/plugin-update",
"version": "4.5.10",
"version": "4.6.0",
"author": "Salesforce",

@@ -9,2 +9,3 @@ "bugs": "https://github.com/oclif/plugin-update/issues",

"@oclif/core": "^4",
"@oclif/table": "^0.1.12",
"ansis": "^3.3.2",

@@ -16,4 +17,3 @@ "debug": "^4.3.7",

"semver": "^7.6.3",
"tar-fs": "^2.1.1",
"tty-table": "^4.2.3"
"tar-fs": "^2.1.1"
},

@@ -20,0 +20,0 @@ "devDependencies": {

@@ -29,6 +29,7 @@ # @oclif/plugin-update

USAGE
$ oclif-example update [CHANNEL] [--force | | [-a | -v <value> | -i]]
$ oclif-example update [CHANNEL] [--force | | [-a | -v <value> | -i]] [-b ]
FLAGS
-a, --available See available versions.
-b, --verbose Show more details about the available versions.
-i, --interactive Interactively select version to install. This is ignored if a channel is provided.

@@ -59,3 +60,3 @@ -v, --version=<value> Install a specific version.

_See code: [src/commands/update.ts](https://github.com/oclif/plugin-update/blob/v4.5.10/src/commands/update.ts)_
_See code: [src/commands/update.ts](https://github.com/oclif/plugin-update/blob/v4.6.0/src/commands/update.ts)_
<!-- commandsstop -->

@@ -62,0 +63,0 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc