From 4ce7ea6e23c5cb15543df8a215274287134682e8 Mon Sep 17 00:00:00 2001 From: Robin Genz Date: Thu, 2 May 2024 10:32:30 +0200 Subject: [PATCH] fix: allow execution of commands in ci --- src/commands/apps/bundles/delete.ts | 5 ----- src/commands/apps/channels/create.ts | 5 ----- src/commands/apps/channels/delete.ts | 5 ----- src/commands/apps/create.ts | 5 ----- src/commands/apps/delete.ts | 5 ----- src/commands/apps/devices/delete.ts | 5 ----- src/commands/login.ts | 1 - 7 files changed, 31 deletions(-) diff --git a/src/commands/apps/bundles/delete.ts b/src/commands/apps/bundles/delete.ts index 3c0cfa4..632af64 100644 --- a/src/commands/apps/bundles/delete.ts +++ b/src/commands/apps/bundles/delete.ts @@ -1,7 +1,6 @@ import { defineCommand } from 'citty'; import consola from 'consola'; import { AxiosError } from 'axios'; -import { isRunningInCi } from '../../../utils/ci'; import appsService from '../../../services/apps'; import { prompt } from '../../../utils/prompt'; import appBundlesService from '../../../services/app-bundle'; @@ -21,10 +20,6 @@ export default defineCommand({ }, }, run: async (ctx) => { - if (isRunningInCi()) { - consola.error('This command is not supported in CI environments.'); - return; - } let appId = ctx.args.appId; if (!appId) { const apps = await appsService.findAll(); diff --git a/src/commands/apps/channels/create.ts b/src/commands/apps/channels/create.ts index 35ecdae..088df00 100644 --- a/src/commands/apps/channels/create.ts +++ b/src/commands/apps/channels/create.ts @@ -1,5 +1,4 @@ import { defineCommand } from 'citty'; -import { isRunningInCi } from '../../../utils/ci'; import consola from 'consola'; import { prompt } from '../../../utils/prompt'; import appsService from '../../../services/apps'; @@ -21,10 +20,6 @@ export default defineCommand({ }, }, run: async (ctx) => { - if (isRunningInCi()) { - consola.error('This command is not supported in CI environments.'); - return; - } let appId = ctx.args.appId; if (!appId) { const apps = await appsService.findAll(); diff --git a/src/commands/apps/channels/delete.ts b/src/commands/apps/channels/delete.ts index 08443e1..eb0f652 100644 --- a/src/commands/apps/channels/delete.ts +++ b/src/commands/apps/channels/delete.ts @@ -1,7 +1,6 @@ import { defineCommand } from 'citty'; import consola from 'consola'; import { AxiosError } from 'axios'; -import { isRunningInCi } from '../../../utils/ci'; import appsService from '../../../services/apps'; import { prompt } from '../../../utils/prompt'; import appChannelsService from '../../../services/app-channel'; @@ -21,10 +20,6 @@ export default defineCommand({ }, }, run: async (ctx) => { - if (isRunningInCi()) { - consola.error('This command is not supported in CI environments.'); - return; - } let appId = ctx.args.appId; if (!appId) { const apps = await appsService.findAll(); diff --git a/src/commands/apps/create.ts b/src/commands/apps/create.ts index 7da6a96..ed2bcfc 100644 --- a/src/commands/apps/create.ts +++ b/src/commands/apps/create.ts @@ -1,5 +1,4 @@ import { defineCommand } from 'citty'; -import { isRunningInCi } from '../../utils/ci'; import consola from 'consola'; import { prompt } from '../../utils/prompt'; import appsService from '../../services/apps'; @@ -16,10 +15,6 @@ export default defineCommand({ }, }, run: async (ctx) => { - if (isRunningInCi()) { - consola.error('This command is not supported in CI environments.'); - return; - } let name = ctx.args.name; if (!name) { name = await prompt('Enter the name of the app:', { type: 'text' }); diff --git a/src/commands/apps/delete.ts b/src/commands/apps/delete.ts index f058d6a..1364663 100644 --- a/src/commands/apps/delete.ts +++ b/src/commands/apps/delete.ts @@ -1,5 +1,4 @@ import { defineCommand } from 'citty'; -import { isRunningInCi } from '../../utils/ci'; import consola from 'consola'; import { prompt } from '../../utils/prompt'; import appsService from '../../services/apps'; @@ -16,10 +15,6 @@ export default defineCommand({ }, }, run: async (ctx) => { - if (isRunningInCi()) { - consola.error('This command is not supported in CI environments.'); - return; - } let appId = ctx.args.appId; if (!appId) { const apps = await appsService.findAll(); diff --git a/src/commands/apps/devices/delete.ts b/src/commands/apps/devices/delete.ts index d4a404b..1507f81 100644 --- a/src/commands/apps/devices/delete.ts +++ b/src/commands/apps/devices/delete.ts @@ -1,7 +1,6 @@ import { defineCommand } from 'citty'; import consola from 'consola'; import { AxiosError } from 'axios'; -import { isRunningInCi } from '../../../utils/ci'; import appsService from '../../../services/apps'; import { prompt } from '../../../utils/prompt'; import appDevicesService from '../../../services/app-device'; @@ -21,10 +20,6 @@ export default defineCommand({ }, }, run: async (ctx) => { - if (isRunningInCi()) { - consola.error('This command is not supported in CI environments.'); - return; - } let appId = ctx.args.appId; if (!appId) { const apps = await appsService.findAll(); diff --git a/src/commands/login.ts b/src/commands/login.ts index 45db3a5..da5ec2a 100644 --- a/src/commands/login.ts +++ b/src/commands/login.ts @@ -4,7 +4,6 @@ import axios from 'axios'; import userConfig from '../utils/userConfig'; import { API_URL } from '../config'; import { passwordPrompt, prompt } from '../utils/prompt'; -import { isRunningInCi } from '../utils/ci'; import usersService from '../services/users'; export default defineCommand({