@capawesome/cli 3.2.1-dev.fa8dc69.1759001719 → 3.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +7 -0
- package/dist/commands/apps/bundles/create.js +5 -5
- package/dist/commands/apps/bundles/delete.js +6 -6
- package/dist/commands/apps/bundles/delete.test.js +1 -1
- package/dist/commands/apps/bundles/update.js +5 -5
- package/dist/commands/apps/bundles/update.test.js +1 -1
- package/dist/commands/apps/channels/create.js +5 -5
- package/dist/commands/apps/channels/create.test.js +1 -1
- package/dist/commands/apps/channels/delete.js +6 -6
- package/dist/commands/apps/channels/delete.test.js +1 -1
- package/dist/commands/apps/channels/update.js +5 -5
- package/dist/commands/apps/channels/update.test.js +1 -1
- package/dist/commands/apps/create.js +5 -5
- package/dist/commands/apps/create.test.js +1 -1
- package/dist/commands/apps/delete.js +4 -4
- package/dist/commands/apps/delete.test.js +1 -1
- package/dist/commands/apps/devices/delete.js +6 -6
- package/dist/commands/apps/devices/delete.test.js +1 -1
- package/dist/commands/login.js +3 -3
- package/dist/commands/login.test.js +2 -2
- package/dist/commands/manifests/generate.js +3 -3
- package/dist/commands/manifests/generate.test.js +1 -1
- package/dist/commands/organizations/create.js +3 -3
- package/dist/commands/organizations/create.test.js +1 -1
- package/package.json +1 -2
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,13 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file. See [commit-and-tag-version](https://github.com/absolute-version/commit-and-tag-version) for commit guidelines.
|
|
4
4
|
|
|
5
|
+
## [3.2.2](https://github.com/capawesome-team/cli/compare/v3.2.1...v3.2.2) (2025-09-29)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### Bug Fixes
|
|
9
|
+
|
|
10
|
+
* check for interactive terminal interface before prompt ([#86](https://github.com/capawesome-team/cli/issues/86)) ([ed8b6b0](https://github.com/capawesome-team/cli/commit/ed8b6b07d5ddedb10541472cf769176095c24645)), closes [#85](https://github.com/capawesome-team/cli/issues/85)
|
|
11
|
+
|
|
5
12
|
## [3.2.1](https://github.com/capawesome-team/cli/compare/v3.2.0...v3.2.1) (2025-09-26)
|
|
6
13
|
|
|
7
14
|
|
|
@@ -15,7 +15,7 @@ import zip from '../../../utils/zip.js';
|
|
|
15
15
|
import { defineCommand, defineOptions } from '@robingenz/zli';
|
|
16
16
|
import consola from 'consola';
|
|
17
17
|
import { createReadStream } from 'fs';
|
|
18
|
-
import { hasTTY
|
|
18
|
+
import { hasTTY } from 'std-env';
|
|
19
19
|
import { z } from 'zod';
|
|
20
20
|
export default defineCommand({
|
|
21
21
|
description: 'Create a new app bundle.',
|
|
@@ -104,8 +104,8 @@ export default defineCommand({
|
|
|
104
104
|
}
|
|
105
105
|
// Check that either a path or a url is provided
|
|
106
106
|
if (!path && !url) {
|
|
107
|
-
if (
|
|
108
|
-
consola.error('You must provide either a path or a url when running in
|
|
107
|
+
if (!hasTTY) {
|
|
108
|
+
consola.error('You must provide either a path or a url when running in non-interactive environment.');
|
|
109
109
|
process.exit(1);
|
|
110
110
|
}
|
|
111
111
|
else {
|
|
@@ -157,8 +157,8 @@ export default defineCommand({
|
|
|
157
157
|
process.exit(1);
|
|
158
158
|
}
|
|
159
159
|
if (!appId) {
|
|
160
|
-
if (
|
|
161
|
-
consola.error('You must provide an app ID when running in
|
|
160
|
+
if (!hasTTY) {
|
|
161
|
+
consola.error('You must provide an app ID when running in non-interactive environment.');
|
|
162
162
|
process.exit(1);
|
|
163
163
|
}
|
|
164
164
|
const organizations = await organizationsService.findAll();
|
|
@@ -5,7 +5,7 @@ import organizationsService from '../../../services/organizations.js';
|
|
|
5
5
|
import { prompt } from '../../../utils/prompt.js';
|
|
6
6
|
import { defineCommand, defineOptions } from '@robingenz/zli';
|
|
7
7
|
import consola from 'consola';
|
|
8
|
-
import {
|
|
8
|
+
import { hasTTY } from 'std-env';
|
|
9
9
|
import { z } from 'zod';
|
|
10
10
|
export default defineCommand({
|
|
11
11
|
description: 'Delete an app bundle.',
|
|
@@ -21,8 +21,8 @@ export default defineCommand({
|
|
|
21
21
|
}
|
|
22
22
|
// Prompt for missing arguments
|
|
23
23
|
if (!appId) {
|
|
24
|
-
if (
|
|
25
|
-
consola.error('You must provide an app ID when running in
|
|
24
|
+
if (!hasTTY) {
|
|
25
|
+
consola.error('You must provide an app ID when running in non-interactive environment.');
|
|
26
26
|
process.exit(1);
|
|
27
27
|
}
|
|
28
28
|
const organizations = await organizationsService.findAll();
|
|
@@ -53,8 +53,8 @@ export default defineCommand({
|
|
|
53
53
|
});
|
|
54
54
|
}
|
|
55
55
|
if (!bundleId) {
|
|
56
|
-
if (
|
|
57
|
-
consola.error('You must provide the bundle ID when running in
|
|
56
|
+
if (!hasTTY) {
|
|
57
|
+
consola.error('You must provide the bundle ID when running in non-interactive environment.');
|
|
58
58
|
process.exit(1);
|
|
59
59
|
}
|
|
60
60
|
bundleId = await prompt('Enter the bundle ID:', {
|
|
@@ -62,7 +62,7 @@ export default defineCommand({
|
|
|
62
62
|
});
|
|
63
63
|
}
|
|
64
64
|
// Confirm deletion
|
|
65
|
-
if (
|
|
65
|
+
if (hasTTY) {
|
|
66
66
|
const confirmed = await prompt('Are you sure you want to delete this bundle?', {
|
|
67
67
|
type: 'confirm',
|
|
68
68
|
});
|
|
@@ -12,7 +12,7 @@ vi.mock('@/utils/prompt.js');
|
|
|
12
12
|
vi.mock('@/services/authorization-service.js');
|
|
13
13
|
vi.mock('consola');
|
|
14
14
|
vi.mock('std-env', () => ({
|
|
15
|
-
|
|
15
|
+
hasTTY: true,
|
|
16
16
|
}));
|
|
17
17
|
describe('apps-bundles-delete', () => {
|
|
18
18
|
const mockUserConfig = vi.mocked(userConfig);
|
|
@@ -5,7 +5,7 @@ import organizationsService from '../../../services/organizations.js';
|
|
|
5
5
|
import { prompt } from '../../../utils/prompt.js';
|
|
6
6
|
import { defineCommand, defineOptions } from '@robingenz/zli';
|
|
7
7
|
import consola from 'consola';
|
|
8
|
-
import {
|
|
8
|
+
import { hasTTY } from 'std-env';
|
|
9
9
|
import { z } from 'zod';
|
|
10
10
|
export default defineCommand({
|
|
11
11
|
description: 'Update an app bundle.',
|
|
@@ -45,8 +45,8 @@ export default defineCommand({
|
|
|
45
45
|
}
|
|
46
46
|
// Prompt for missing arguments
|
|
47
47
|
if (!appId) {
|
|
48
|
-
if (
|
|
49
|
-
consola.error('You must provide an app ID when running in
|
|
48
|
+
if (!hasTTY) {
|
|
49
|
+
consola.error('You must provide an app ID when running in non-interactive environment.');
|
|
50
50
|
process.exit(1);
|
|
51
51
|
}
|
|
52
52
|
const organizations = await organizationsService.findAll();
|
|
@@ -77,8 +77,8 @@ export default defineCommand({
|
|
|
77
77
|
});
|
|
78
78
|
}
|
|
79
79
|
if (!bundleId) {
|
|
80
|
-
if (
|
|
81
|
-
consola.error('You must provide the bundle ID when running in
|
|
80
|
+
if (!hasTTY) {
|
|
81
|
+
consola.error('You must provide the bundle ID when running in non-interactive environment.');
|
|
82
82
|
process.exit(1);
|
|
83
83
|
}
|
|
84
84
|
bundleId = await prompt('Enter the bundle ID:', {
|
|
@@ -12,7 +12,7 @@ vi.mock('@/utils/prompt.js');
|
|
|
12
12
|
vi.mock('@/services/authorization-service.js');
|
|
13
13
|
vi.mock('consola');
|
|
14
14
|
vi.mock('std-env', () => ({
|
|
15
|
-
|
|
15
|
+
hasTTY: true,
|
|
16
16
|
}));
|
|
17
17
|
describe('apps-bundles-update', () => {
|
|
18
18
|
const mockUserConfig = vi.mocked(userConfig);
|
|
@@ -6,7 +6,7 @@ import { getMessageFromUnknownError } from '../../../utils/error.js';
|
|
|
6
6
|
import { prompt } from '../../../utils/prompt.js';
|
|
7
7
|
import { defineCommand, defineOptions } from '@robingenz/zli';
|
|
8
8
|
import consola from 'consola';
|
|
9
|
-
import {
|
|
9
|
+
import { hasTTY } from 'std-env';
|
|
10
10
|
import { z } from 'zod';
|
|
11
11
|
export default defineCommand({
|
|
12
12
|
description: 'Create a new app channel.',
|
|
@@ -43,8 +43,8 @@ export default defineCommand({
|
|
|
43
43
|
}
|
|
44
44
|
// Validate the app ID
|
|
45
45
|
if (!appId) {
|
|
46
|
-
if (
|
|
47
|
-
consola.error('You must provide an app ID when running in
|
|
46
|
+
if (!hasTTY) {
|
|
47
|
+
consola.error('You must provide an app ID when running in non-interactive environment.');
|
|
48
48
|
process.exit(1);
|
|
49
49
|
}
|
|
50
50
|
const organizations = await organizationsService.findAll();
|
|
@@ -76,8 +76,8 @@ export default defineCommand({
|
|
|
76
76
|
}
|
|
77
77
|
// Validate the channel name
|
|
78
78
|
if (!name) {
|
|
79
|
-
if (
|
|
80
|
-
consola.error('You must provide the channel name when running in
|
|
79
|
+
if (!hasTTY) {
|
|
80
|
+
consola.error('You must provide the channel name when running in non-interactive environment.');
|
|
81
81
|
process.exit(1);
|
|
82
82
|
}
|
|
83
83
|
name = await prompt('Enter the name of the channel:', { type: 'text' });
|
|
@@ -12,7 +12,7 @@ vi.mock('@/utils/prompt.js');
|
|
|
12
12
|
vi.mock('@/services/authorization-service.js');
|
|
13
13
|
vi.mock('consola');
|
|
14
14
|
vi.mock('std-env', () => ({
|
|
15
|
-
|
|
15
|
+
hasTTY: true,
|
|
16
16
|
}));
|
|
17
17
|
describe('apps-channels-create', () => {
|
|
18
18
|
const mockUserConfig = vi.mocked(userConfig);
|
|
@@ -5,7 +5,7 @@ import organizationsService from '../../../services/organizations.js';
|
|
|
5
5
|
import { prompt } from '../../../utils/prompt.js';
|
|
6
6
|
import { defineCommand, defineOptions } from '@robingenz/zli';
|
|
7
7
|
import consola from 'consola';
|
|
8
|
-
import {
|
|
8
|
+
import { hasTTY } from 'std-env';
|
|
9
9
|
import { z } from 'zod';
|
|
10
10
|
export default defineCommand({
|
|
11
11
|
description: 'Delete an app channel.',
|
|
@@ -27,8 +27,8 @@ export default defineCommand({
|
|
|
27
27
|
process.exit(1);
|
|
28
28
|
}
|
|
29
29
|
if (!appId) {
|
|
30
|
-
if (
|
|
31
|
-
consola.error('You must provide an app ID when running in
|
|
30
|
+
if (!hasTTY) {
|
|
31
|
+
consola.error('You must provide an app ID when running in non-interactive environment.');
|
|
32
32
|
process.exit(1);
|
|
33
33
|
}
|
|
34
34
|
const organizations = await organizationsService.findAll();
|
|
@@ -60,8 +60,8 @@ export default defineCommand({
|
|
|
60
60
|
}
|
|
61
61
|
// Prompt for channel ID or name if neither is provided
|
|
62
62
|
if (!channelId && !name) {
|
|
63
|
-
if (
|
|
64
|
-
consola.error('You must provide either the channel ID or name when running in
|
|
63
|
+
if (!hasTTY) {
|
|
64
|
+
consola.error('You must provide either the channel ID or name when running in non-interactive environment.');
|
|
65
65
|
process.exit(1);
|
|
66
66
|
}
|
|
67
67
|
name = await prompt('Enter the channel name:', {
|
|
@@ -69,7 +69,7 @@ export default defineCommand({
|
|
|
69
69
|
});
|
|
70
70
|
}
|
|
71
71
|
// Confirm deletion
|
|
72
|
-
if (
|
|
72
|
+
if (hasTTY) {
|
|
73
73
|
const confirmed = await prompt('Are you sure you want to delete this channel?', {
|
|
74
74
|
type: 'confirm',
|
|
75
75
|
});
|
|
@@ -12,7 +12,7 @@ vi.mock('@/utils/prompt.js');
|
|
|
12
12
|
vi.mock('@/services/authorization-service.js');
|
|
13
13
|
vi.mock('consola');
|
|
14
14
|
vi.mock('std-env', () => ({
|
|
15
|
-
|
|
15
|
+
hasTTY: true,
|
|
16
16
|
}));
|
|
17
17
|
describe('apps-channels-delete', () => {
|
|
18
18
|
const mockUserConfig = vi.mocked(userConfig);
|
|
@@ -5,7 +5,7 @@ import organizationsService from '../../../services/organizations.js';
|
|
|
5
5
|
import { prompt } from '../../../utils/prompt.js';
|
|
6
6
|
import { defineCommand, defineOptions } from '@robingenz/zli';
|
|
7
7
|
import consola from 'consola';
|
|
8
|
-
import {
|
|
8
|
+
import { hasTTY } from 'std-env';
|
|
9
9
|
import { z } from 'zod';
|
|
10
10
|
export default defineCommand({
|
|
11
11
|
description: 'Update an existing app channel.',
|
|
@@ -26,8 +26,8 @@ export default defineCommand({
|
|
|
26
26
|
}
|
|
27
27
|
// Prompt app ID if not provided
|
|
28
28
|
if (!appId) {
|
|
29
|
-
if (
|
|
30
|
-
consola.error('You must provide an app ID when running in
|
|
29
|
+
if (!hasTTY) {
|
|
30
|
+
consola.error('You must provide an app ID when running in non-interactive environment.');
|
|
31
31
|
process.exit(1);
|
|
32
32
|
}
|
|
33
33
|
const organizations = await organizationsService.findAll();
|
|
@@ -59,8 +59,8 @@ export default defineCommand({
|
|
|
59
59
|
}
|
|
60
60
|
// Prompt for channel ID if not provided
|
|
61
61
|
if (!channelId) {
|
|
62
|
-
if (
|
|
63
|
-
consola.error('You must provide the channel ID when running in
|
|
62
|
+
if (!hasTTY) {
|
|
63
|
+
consola.error('You must provide the channel ID when running in non-interactive environment.');
|
|
64
64
|
process.exit(1);
|
|
65
65
|
}
|
|
66
66
|
channelId = await prompt('Enter the channel ID:', {
|
|
@@ -12,7 +12,7 @@ vi.mock('@/utils/prompt.js');
|
|
|
12
12
|
vi.mock('@/services/authorization-service.js');
|
|
13
13
|
vi.mock('consola');
|
|
14
14
|
vi.mock('std-env', () => ({
|
|
15
|
-
|
|
15
|
+
hasTTY: true,
|
|
16
16
|
}));
|
|
17
17
|
describe('apps-channels-update', () => {
|
|
18
18
|
const mockUserConfig = vi.mocked(userConfig);
|
|
@@ -4,7 +4,7 @@ import organizationsService from '../../services/organizations.js';
|
|
|
4
4
|
import { prompt } from '../../utils/prompt.js';
|
|
5
5
|
import { defineCommand, defineOptions } from '@robingenz/zli';
|
|
6
6
|
import consola from 'consola';
|
|
7
|
-
import {
|
|
7
|
+
import { hasTTY } from 'std-env';
|
|
8
8
|
import { z } from 'zod';
|
|
9
9
|
export default defineCommand({
|
|
10
10
|
description: 'Create a new app.',
|
|
@@ -19,8 +19,8 @@ export default defineCommand({
|
|
|
19
19
|
process.exit(1);
|
|
20
20
|
}
|
|
21
21
|
if (!organizationId) {
|
|
22
|
-
if (
|
|
23
|
-
consola.error('You must provide the organization ID when running in
|
|
22
|
+
if (!hasTTY) {
|
|
23
|
+
consola.error('You must provide the organization ID when running in non-interactive environment.');
|
|
24
24
|
process.exit(1);
|
|
25
25
|
}
|
|
26
26
|
const organizations = await organizationsService.findAll();
|
|
@@ -39,8 +39,8 @@ export default defineCommand({
|
|
|
39
39
|
}
|
|
40
40
|
}
|
|
41
41
|
if (!name) {
|
|
42
|
-
if (
|
|
43
|
-
consola.error('You must provide the app name when running in
|
|
42
|
+
if (!hasTTY) {
|
|
43
|
+
consola.error('You must provide the app name when running in non-interactive environment.');
|
|
44
44
|
process.exit(1);
|
|
45
45
|
}
|
|
46
46
|
name = await prompt('Enter the name of the app:', { type: 'text' });
|
|
@@ -4,7 +4,7 @@ import organizationsService from '../../services/organizations.js';
|
|
|
4
4
|
import { prompt } from '../../utils/prompt.js';
|
|
5
5
|
import { defineCommand, defineOptions } from '@robingenz/zli';
|
|
6
6
|
import consola from 'consola';
|
|
7
|
-
import {
|
|
7
|
+
import { hasTTY } from 'std-env';
|
|
8
8
|
import { z } from 'zod';
|
|
9
9
|
export default defineCommand({
|
|
10
10
|
description: 'Delete an app.',
|
|
@@ -18,8 +18,8 @@ export default defineCommand({
|
|
|
18
18
|
process.exit(1);
|
|
19
19
|
}
|
|
20
20
|
if (!appId) {
|
|
21
|
-
if (
|
|
22
|
-
consola.error('You must provide the app ID when running in
|
|
21
|
+
if (!hasTTY) {
|
|
22
|
+
consola.error('You must provide the app ID when running in non-interactive environment.');
|
|
23
23
|
process.exit(1);
|
|
24
24
|
}
|
|
25
25
|
const organizations = await organizationsService.findAll();
|
|
@@ -49,7 +49,7 @@ export default defineCommand({
|
|
|
49
49
|
options: apps.map((app) => ({ label: app.name, value: app.id })),
|
|
50
50
|
});
|
|
51
51
|
}
|
|
52
|
-
if (
|
|
52
|
+
if (hasTTY) {
|
|
53
53
|
const confirmed = await prompt('Are you sure you want to delete this app?', {
|
|
54
54
|
type: 'confirm',
|
|
55
55
|
});
|
|
@@ -5,7 +5,7 @@ import organizationsService from '../../../services/organizations.js';
|
|
|
5
5
|
import { prompt } from '../../../utils/prompt.js';
|
|
6
6
|
import { defineCommand, defineOptions } from '@robingenz/zli';
|
|
7
7
|
import consola from 'consola';
|
|
8
|
-
import {
|
|
8
|
+
import { hasTTY } from 'std-env';
|
|
9
9
|
import { z } from 'zod';
|
|
10
10
|
export default defineCommand({
|
|
11
11
|
description: 'Delete an app device.',
|
|
@@ -21,8 +21,8 @@ export default defineCommand({
|
|
|
21
21
|
}
|
|
22
22
|
// Prompt for app ID if not provided
|
|
23
23
|
if (!appId) {
|
|
24
|
-
if (
|
|
25
|
-
consola.error('You must provide an app ID when running in
|
|
24
|
+
if (!hasTTY) {
|
|
25
|
+
consola.error('You must provide an app ID when running in non-interactive environment.');
|
|
26
26
|
process.exit(1);
|
|
27
27
|
}
|
|
28
28
|
const organizations = await organizationsService.findAll();
|
|
@@ -54,8 +54,8 @@ export default defineCommand({
|
|
|
54
54
|
}
|
|
55
55
|
// Prompt for device ID if not provided
|
|
56
56
|
if (!deviceId) {
|
|
57
|
-
if (
|
|
58
|
-
consola.error('You must provide the device ID when running in
|
|
57
|
+
if (!hasTTY) {
|
|
58
|
+
consola.error('You must provide the device ID when running in non-interactive environment.');
|
|
59
59
|
process.exit(1);
|
|
60
60
|
}
|
|
61
61
|
deviceId = await prompt('Enter the device ID:', {
|
|
@@ -63,7 +63,7 @@ export default defineCommand({
|
|
|
63
63
|
});
|
|
64
64
|
}
|
|
65
65
|
// Confirm deletion
|
|
66
|
-
if (
|
|
66
|
+
if (hasTTY) {
|
|
67
67
|
const confirmed = await prompt('Are you sure you want to delete this device?', {
|
|
68
68
|
type: 'confirm',
|
|
69
69
|
});
|
|
@@ -12,7 +12,7 @@ vi.mock('@/utils/prompt.js');
|
|
|
12
12
|
vi.mock('@/services/authorization-service.js');
|
|
13
13
|
vi.mock('consola');
|
|
14
14
|
vi.mock('std-env', () => ({
|
|
15
|
-
|
|
15
|
+
hasTTY: true,
|
|
16
16
|
}));
|
|
17
17
|
describe('apps-devices-delete', () => {
|
|
18
18
|
const mockUserConfig = vi.mocked(userConfig);
|
package/dist/commands/login.js
CHANGED
|
@@ -8,7 +8,7 @@ import { defineCommand, defineOptions } from '@robingenz/zli';
|
|
|
8
8
|
import { AxiosError } from 'axios';
|
|
9
9
|
import consola from 'consola';
|
|
10
10
|
import open from 'open';
|
|
11
|
-
import {
|
|
11
|
+
import { hasTTY } from 'std-env';
|
|
12
12
|
import { z } from 'zod';
|
|
13
13
|
export default defineCommand({
|
|
14
14
|
description: 'Sign in to the Capawesome Cloud Console.',
|
|
@@ -19,8 +19,8 @@ export default defineCommand({
|
|
|
19
19
|
const consoleBaseUrl = await configService.getValueForKey('CONSOLE_BASE_URL');
|
|
20
20
|
let { token: sessionIdOrToken } = options;
|
|
21
21
|
if (sessionIdOrToken === undefined) {
|
|
22
|
-
if (
|
|
23
|
-
consola.error('You must provide a token when running in
|
|
22
|
+
if (!hasTTY) {
|
|
23
|
+
consola.error('You must provide a token when running in non-interactive environment.');
|
|
24
24
|
process.exit(1);
|
|
25
25
|
}
|
|
26
26
|
// @ts-ignore wait till https://github.com/unjs/consola/pull/280 is merged
|
|
@@ -18,10 +18,10 @@ vi.mock('open');
|
|
|
18
18
|
vi.mock('consola');
|
|
19
19
|
vi.mock('@/utils/prompt.js');
|
|
20
20
|
vi.mock('std-env', () => ({
|
|
21
|
-
|
|
21
|
+
hasTTY: true,
|
|
22
22
|
}));
|
|
23
23
|
vi.mock('std-env', () => ({
|
|
24
|
-
|
|
24
|
+
hasTTY: true,
|
|
25
25
|
}));
|
|
26
26
|
describe('login', () => {
|
|
27
27
|
const mockUserConfig = vi.mocked(userConfig);
|
|
@@ -3,7 +3,7 @@ import { generateManifestJson } from '../../utils/manifest.js';
|
|
|
3
3
|
import { prompt } from '../../utils/prompt.js';
|
|
4
4
|
import { defineCommand, defineOptions } from '@robingenz/zli';
|
|
5
5
|
import consola from 'consola';
|
|
6
|
-
import {
|
|
6
|
+
import { hasTTY } from 'std-env';
|
|
7
7
|
import { z } from 'zod';
|
|
8
8
|
export default defineCommand({
|
|
9
9
|
description: 'Generate a manifest file.',
|
|
@@ -13,8 +13,8 @@ export default defineCommand({
|
|
|
13
13
|
action: async (options, args) => {
|
|
14
14
|
let path = options.path;
|
|
15
15
|
if (!path) {
|
|
16
|
-
if (
|
|
17
|
-
consola.error('You must provide the path to the web assets folder when running in
|
|
16
|
+
if (!hasTTY) {
|
|
17
|
+
consola.error('You must provide the path to the web assets folder when running in non-interactive environment.');
|
|
18
18
|
process.exit(1);
|
|
19
19
|
}
|
|
20
20
|
path = await prompt('Enter the path to the web assets folder:', {
|
|
@@ -10,7 +10,7 @@ vi.mock('@/utils/manifest.js');
|
|
|
10
10
|
vi.mock('@/utils/prompt.js');
|
|
11
11
|
vi.mock('consola');
|
|
12
12
|
vi.mock('std-env', () => ({
|
|
13
|
-
|
|
13
|
+
hasTTY: true,
|
|
14
14
|
}));
|
|
15
15
|
describe('manifests-generate', () => {
|
|
16
16
|
const mockFileExistsAtPath = vi.mocked(fileExistsAtPath);
|
|
@@ -3,7 +3,7 @@ import organizationsService from '../../services/organizations.js';
|
|
|
3
3
|
import { prompt } from '../../utils/prompt.js';
|
|
4
4
|
import { defineCommand, defineOptions } from '@robingenz/zli';
|
|
5
5
|
import consola from 'consola';
|
|
6
|
-
import {
|
|
6
|
+
import { hasTTY } from 'std-env';
|
|
7
7
|
import { z } from 'zod';
|
|
8
8
|
export default defineCommand({
|
|
9
9
|
description: 'Create a new organization.',
|
|
@@ -17,8 +17,8 @@ export default defineCommand({
|
|
|
17
17
|
process.exit(1);
|
|
18
18
|
}
|
|
19
19
|
if (!name) {
|
|
20
|
-
if (
|
|
21
|
-
consola.error('You must provide the organization name when running in
|
|
20
|
+
if (!hasTTY) {
|
|
21
|
+
consola.error('You must provide the organization name when running in non-interactive environment.');
|
|
22
22
|
process.exit(1);
|
|
23
23
|
}
|
|
24
24
|
name = await prompt('Enter the name of the organization:', { type: 'text' });
|
|
@@ -12,7 +12,7 @@ vi.mock('@/utils/prompt.js');
|
|
|
12
12
|
vi.mock('@/services/authorization-service.js');
|
|
13
13
|
vi.mock('consola');
|
|
14
14
|
vi.mock('std-env', () => ({
|
|
15
|
-
|
|
15
|
+
hasTTY: true,
|
|
16
16
|
}));
|
|
17
17
|
describe('organizations-create', () => {
|
|
18
18
|
const mockUserConfig = vi.mocked(userConfig);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@capawesome/cli",
|
|
3
|
-
"version": "3.2.
|
|
3
|
+
"version": "3.2.2",
|
|
4
4
|
"description": "The Capawesome Cloud Command Line Interface (CLI) to manage Live Updates and more.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"scripts": {
|
|
@@ -16,7 +16,6 @@
|
|
|
16
16
|
"sentry:releases:set-commits": "sentry-cli releases set-commits capawesome-team-cli@$npm_package_version --auto --org genz-it-solutions-gmbh --project capawesome-team-cli",
|
|
17
17
|
"sentry:releases:finalize": "sentry-cli releases finalize capawesome-team-cli@$npm_package_version --org genz-it-solutions-gmbh --project capawesome-team-cli",
|
|
18
18
|
"release": "commit-and-tag-version",
|
|
19
|
-
"prepublishOnly": "npm run build && npm run sentry:releases:new && npm run sentry:releases:set-commits",
|
|
20
19
|
"postpublish": "npm run sentry:releases:finalize"
|
|
21
20
|
},
|
|
22
21
|
"engines": {
|