Skip to content

Commit e1c4969

Browse files
authored
refactor(vm): remove feature flag check for VMs (#122)
1 parent d3c669c commit e1c4969

3 files changed

Lines changed: 9 additions & 15 deletions

File tree

src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ registerUpgrade(program);
4444
// registerScale(program);
4545
registerClusters(program);
4646
registerMe(program);
47-
await registerVM(program);
47+
registerVM(program);
4848

4949
// (development commands)
5050
registerDev(program);

src/lib/posthog.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ const trackEvent = ({
6767
}
6868
};
6969

70-
type FeatureFlags = "vms";
70+
type FeatureFlags = "";
7171

7272
/**
7373
* Checks if a feature is enabled for the current user.

src/lib/vm.ts

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,18 @@
11
import type { Command } from "@commander-js/extra-typings";
2-
import console from "node:console";
32
import { confirm } from "@inquirer/prompts";
4-
import ora from "ora";
3+
import Table from "cli-table3";
4+
import console from "node:console";
55
import { readFileSync } from "node:fs";
6+
import process from "node:process";
67
import { setTimeout } from "node:timers";
7-
import Table from "cli-table3";
8+
import ora from "ora";
89
import { getAuthToken } from "../helpers/config.ts";
9-
import process from "node:process";
1010
import {
1111
logAndQuit,
1212
logSessionTokenExpiredAndQuit,
1313
logSupportCTAAndQuit,
1414
} from "../helpers/errors.ts";
1515
import { getApiUrl } from "../helpers/urls.ts";
16-
import { isFeatureEnabled } from "./posthog.ts";
1716
import { registerSsh } from "./ssh.ts";
1817

1918
type VMInstance = {
@@ -23,13 +22,7 @@ type VMInstance = {
2322
last_updated_at: string;
2423
};
2524

26-
export async function registerVM(program: Command) {
27-
const isEnabled = await isFeatureEnabled("vms");
28-
29-
if (!isEnabled) {
30-
return;
31-
}
32-
25+
export function registerVM(program: Command) {
3326
const vm = program
3427
.command("vm")
3528
.aliases(["v", "vms"])
@@ -132,7 +125,8 @@ export async function registerVM(program: Command) {
132125
(val) => {
133126
const parsedValue = Number(val);
134127
if (
135-
Number.isNaN(parsedValue) || !Number.isInteger(parsedValue) ||
128+
Number.isNaN(parsedValue) ||
129+
!Number.isInteger(parsedValue) ||
136130
parsedValue <= 0
137131
) {
138132
logAndQuit("Limit must be a positive integer");

0 commit comments

Comments
 (0)