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

@hypermode/modus-cli

Package Overview
Dependencies
Maintainers
0
Versions
31
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@hypermode/modus-cli - npm Package Compare versions

Comparing version 0.13.0 to 0.13.1

5

dist/commands/new/index.js

@@ -121,2 +121,5 @@ /*

}
else {
throw err;
}
}

@@ -196,3 +199,3 @@ }

if (!installedSdkVersion) {
const confirmed = inquirer.confirm({
const confirmed = await inquirer.confirm({
message: `You do not have the ${sdkText} installed. Would you like to install it now?`,

@@ -199,0 +202,0 @@ default: true,

70

dist/commands/runtime/remove/index.js

@@ -37,15 +37,15 @@ /*

async run() {
const { args, flags } = await this.parse(RuntimeRemoveCommand);
if (!args.version) {
this.logError(`No runtime version specified. Run ${chalk.whiteBright("modus runtime remove <version>")}, or ${chalk.whiteBright("modus runtime remove all")}`);
return;
}
if (args.version.toLowerCase() === "all") {
const versions = await vi.getInstalledRuntimeVersions();
if (versions.length === 0) {
this.log(chalk.yellow("No Modus runtimes are installed."));
this.exit(1);
try {
const { args, flags } = await this.parse(RuntimeRemoveCommand);
if (!args.version) {
this.logError(`No runtime version specified. Run ${chalk.whiteBright("modus runtime remove <version>")}, or ${chalk.whiteBright("modus runtime remove all")}`);
return;
}
else if (!flags.force) {
try {
if (args.version.toLowerCase() === "all") {
const versions = await vi.getInstalledRuntimeVersions();
if (versions.length === 0) {
this.log(chalk.yellow("No Modus runtimes are installed."));
this.exit(1);
}
else if (!flags.force) {
const confirmed = await inquirer.confirm({

@@ -59,25 +59,18 @@ message: "Are you sure you want to remove all Modus runtimes?",

}
catch (err) {
if (err.name === "ExitPromptError") {
this.abort();
}
for (const version of versions) {
await this.removeRuntime(version);
}
}
for (const version of versions) {
await this.removeRuntime(version);
}
}
else if (!args.version.startsWith("v")) {
this.logError("Version must start with 'v'.");
this.exit(1);
}
else {
const runtimeText = `Modus Runtime ${args.version}`;
const isInstalled = await vi.runtimeVersionIsInstalled(args.version);
if (!isInstalled) {
this.log(chalk.yellow(runtimeText + "is not installed."));
else if (!args.version.startsWith("v")) {
this.logError("Version must start with 'v'.");
this.exit(1);
}
else if (!flags.force) {
try {
else {
const runtimeText = `Modus Runtime ${args.version}`;
const isInstalled = await vi.runtimeVersionIsInstalled(args.version);
if (!isInstalled) {
this.log(chalk.yellow(runtimeText + "is not installed."));
this.exit(1);
}
else if (!flags.force) {
const confirmed = await inquirer.confirm({

@@ -91,10 +84,13 @@ message: `Are you sure you want to remove ${runtimeText}?`,

}
catch (err) {
if (err.name === "ExitPromptError") {
this.abort();
}
}
await this.removeRuntime(args.version);
}
await this.removeRuntime(args.version);
}
catch (err) {
if (err.name === "ExitPromptError") {
this.abort();
}
else {
throw err;
}
}
}

@@ -101,0 +97,0 @@ async removeRuntime(version) {

@@ -47,23 +47,23 @@ /*

async run() {
const { args, flags } = await this.parse(SDKRemoveCommand);
if (!args.version) {
this.logError(`No SDK specified! Run ${chalk.whiteBright("modus sdk remove <name> [version]")}, or ${chalk.whiteBright("modus sdk remove all")}`);
return;
}
if (args.name.toLowerCase() === "all") {
let found = false;
for (const sdk of Object.values(SDK)) {
const versions = await vi.getInstalledSdkVersions(sdk);
if (versions.length > 0) {
found = true;
break;
try {
const { args, flags } = await this.parse(SDKRemoveCommand);
if (!args.version) {
this.logError(`No SDK specified! Run ${chalk.whiteBright("modus sdk remove <name> [version]")}, or ${chalk.whiteBright("modus sdk remove all")}`);
return;
}
if (args.name.toLowerCase() === "all") {
let found = false;
for (const sdk of Object.values(SDK)) {
const versions = await vi.getInstalledSdkVersions(sdk);
if (versions.length > 0) {
found = true;
break;
}
}
}
if (!found) {
this.log(chalk.yellow("No Modus SDKs are installed."));
this.exit(1);
}
if (!flags.force) {
try {
const confirmed = inquirer.confirm({
if (!found) {
this.log(chalk.yellow("No Modus SDKs are installed."));
this.exit(1);
}
if (!flags.force) {
const confirmed = await inquirer.confirm({
message: "Are you sure you want to remove all Modus SDKs?",

@@ -76,32 +76,25 @@ default: false,

}
catch (err) {
if (err.name === "ExitPromptError") {
this.abort();
for (const sdk of Object.values(SDK)) {
const versions = await vi.getInstalledSdkVersions(sdk);
for (const version of versions) {
await this.removeSDK(sdk, version);
}
}
}
for (const sdk of Object.values(SDK)) {
const versions = await vi.getInstalledSdkVersions(sdk);
for (const version of versions) {
await this.removeSDK(sdk, version);
if (flags.runtimes) {
const versions = await vi.getInstalledRuntimeVersions();
for (const version of versions) {
await this.removeRuntime(version);
}
}
}
if (flags.runtimes) {
const versions = await vi.getInstalledRuntimeVersions();
for (const version of versions) {
await this.removeRuntime(version);
}
}
}
else {
const sdk = parseSDK(args.name);
if (args.version.toLowerCase() === "all") {
const versions = await vi.getInstalledSdkVersions(sdk);
if (versions.length === 0) {
this.log(chalk.yellow(`No Modus ${sdk} SDKs are installed.`));
this.exit(1);
}
else if (!flags.force) {
try {
const confirmed = inquirer.confirm({
else {
const sdk = parseSDK(args.name);
if (args.version.toLowerCase() === "all") {
const versions = await vi.getInstalledSdkVersions(sdk);
if (versions.length === 0) {
this.log(chalk.yellow(`No Modus ${sdk} SDKs are installed.`));
this.exit(1);
}
else if (!flags.force) {
const confirmed = await inquirer.confirm({
message: `Are you sure you want to remove all Modus ${sdk} SDKs?`,

@@ -114,26 +107,19 @@ default: false,

}
catch (err) {
if (err.name === "ExitPromptError") {
this.abort();
}
for (const version of versions) {
await this.removeSDK(sdk, version);
}
}
for (const version of versions) {
await this.removeSDK(sdk, version);
}
}
else if (!args.version.startsWith("v")) {
this.logError("Version must start with 'v'.");
this.exit(1);
}
else {
const sdkText = `Modus ${sdk} SDK ${args.version}`;
const isInstalled = await vi.sdkVersionIsInstalled(sdk, args.version);
if (!isInstalled) {
this.log(chalk.yellow(sdkText + "is not installed."));
else if (!args.version.startsWith("v")) {
this.logError("Version must start with 'v'.");
this.exit(1);
}
else if (!flags.force) {
try {
const confirmed = inquirer.confirm({
else {
const sdkText = `Modus ${sdk} SDK ${args.version}`;
const isInstalled = await vi.sdkVersionIsInstalled(sdk, args.version);
if (!isInstalled) {
this.log(chalk.yellow(sdkText + "is not installed."));
this.exit(1);
}
else if (!flags.force) {
const confirmed = await inquirer.confirm({
message: `Are you sure you want to remove ${sdkText}?`,

@@ -146,11 +132,14 @@ default: false,

}
catch (err) {
if (err.name === "ExitPromptError") {
this.abort();
}
}
await this.removeSDK(sdk, args.version);
}
await this.removeSDK(sdk, args.version);
}
}
catch (err) {
if (err.name === "ExitPromptError") {
this.abort();
}
else {
throw err;
}
}
}

@@ -157,0 +146,0 @@ async removeSDK(sdk, version) {

@@ -612,3 +612,3 @@ {

},
"version": "0.13.0"
"version": "0.13.1"
}
{
"name": "@hypermode/modus-cli",
"version": "0.13.0",
"version": "0.13.1",
"description": "The Modus CLI",

@@ -5,0 +5,0 @@ "author": "Hypermode Inc.",

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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