@capawesome/cli 4.8.1 → 4.8.3

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 CHANGED
@@ -2,6 +2,20 @@
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
+ ## [4.8.3](https://github.com/capawesome-team/cli/compare/v4.8.2...v4.8.3) (2026-04-20)
6
+
7
+
8
+ ### Bug Fixes
9
+
10
+ * validate file existence before reading user-provided files ([#152](https://github.com/capawesome-team/cli/issues/152)) ([f95523e](https://github.com/capawesome-team/cli/commit/f95523e63a7731ceb0a8dc97ab47ed1b8831d968))
11
+
12
+ ## [4.8.2](https://github.com/capawesome-team/cli/compare/v4.8.1...v4.8.2) (2026-04-20)
13
+
14
+
15
+ ### Bug Fixes
16
+
17
+ * validate file existence before reading in `apps:certificates:create` and `apps:destinations:create` ([#151](https://github.com/capawesome-team/cli/issues/151)) ([5e9e405](https://github.com/capawesome-team/cli/commit/5e9e4055bce3f91026daba576c0c7a97b581c1ae))
18
+
5
19
  ## [4.8.1](https://github.com/capawesome-team/cli/compare/v4.8.0...v4.8.1) (2026-04-12)
6
20
 
7
21
 
@@ -6,6 +6,7 @@ import appEnvironmentsService from '../../../services/app-environments.js';
6
6
  import { parseKeyValuePairs } from '../../../utils/app-environments.js';
7
7
  import { withAuth } from '../../../utils/auth.js';
8
8
  import { isInteractive } from '../../../utils/environment.js';
9
+ import { fileExistsAtPath } from '../../../utils/file.js';
9
10
  import { waitForJobCompletion } from '../../../utils/job.js';
10
11
  import { prompt, promptAppSelection, promptOrganizationSelection } from '../../../utils/prompt.js';
11
12
  import zip from '../../../utils/zip.js';
@@ -245,6 +246,11 @@ export default defineCommand({
245
246
  // Parse ad hoc environment variables from inline and file
246
247
  const variablesMap = new Map();
247
248
  if (options.variableFile) {
249
+ const fileExists = await fileExistsAtPath(options.variableFile);
250
+ if (!fileExists) {
251
+ consola.error(`The variable file was not found or is not accessible: ${options.variableFile}`);
252
+ process.exit(1);
253
+ }
248
254
  const fileContent = await fs.readFile(options.variableFile, 'utf-8');
249
255
  const fileVariables = parseKeyValuePairs(fileContent);
250
256
  fileVariables.forEach((v) => variablesMap.set(v.key, v.value));
@@ -2,6 +2,7 @@ import appCertificatesService from '../../../services/app-certificates.js';
2
2
  import appProvisioningProfilesService from '../../../services/app-provisioning-profiles.js';
3
3
  import { withAuth } from '../../../utils/auth.js';
4
4
  import { isInteractive } from '../../../utils/environment.js';
5
+ import { fileExistsAtPath } from '../../../utils/file.js';
5
6
  import { prompt, promptAppSelection, promptOrganizationSelection } from '../../../utils/prompt.js';
6
7
  import { defineCommand, defineOptions } from '@robingenz/zli';
7
8
  import consola from 'consola';
@@ -130,12 +131,22 @@ export default defineCommand({
130
131
  provisioningProfile = [profilePath];
131
132
  }
132
133
  }
134
+ const fileExists = await fileExistsAtPath(file);
135
+ if (!fileExists) {
136
+ consola.error(`The certificate file was not found or is not accessible: ${file}`);
137
+ process.exit(1);
138
+ }
133
139
  const buffer = fs.readFileSync(file);
134
140
  const fileName = path.basename(file);
135
141
  // Upload provisioning profiles first
136
142
  const provisioningProfileIds = [];
137
143
  if (provisioningProfile && provisioningProfile.length > 0) {
138
144
  for (const profilePath of provisioningProfile) {
145
+ const profileExists = await fileExistsAtPath(profilePath);
146
+ if (!profileExists) {
147
+ consola.error(`The provisioning profile file was not found or is not accessible: ${profilePath}`);
148
+ process.exit(1);
149
+ }
139
150
  const profileBuffer = fs.readFileSync(profilePath);
140
151
  const profileFileName = path.basename(profilePath);
141
152
  const profile = await appProvisioningProfilesService.create({
@@ -3,6 +3,7 @@ import appDestinationsService from '../../../services/app-destinations.js';
3
3
  import appGoogleServiceAccountKeysService from '../../../services/app-google-service-account-keys.js';
4
4
  import { withAuth } from '../../../utils/auth.js';
5
5
  import { isInteractive } from '../../../utils/environment.js';
6
+ import { fileExistsAtPath } from '../../../utils/file.js';
6
7
  import { prompt, promptAppSelection, promptOrganizationSelection } from '../../../utils/prompt.js';
7
8
  import { defineCommand, defineOptions } from '@robingenz/zli';
8
9
  import consola from 'consola';
@@ -153,6 +154,11 @@ export default defineCommand({
153
154
  }
154
155
  }
155
156
  // Upload Google service account key file
157
+ const googleServiceAccountKeyFileExists = await fileExistsAtPath(googleServiceAccountKeyFile);
158
+ if (!googleServiceAccountKeyFileExists) {
159
+ consola.error(`The Google service account key file was not found or is not accessible: ${googleServiceAccountKeyFile}`);
160
+ process.exit(1);
161
+ }
156
162
  const buffer = fs.readFileSync(googleServiceAccountKeyFile);
157
163
  const fileName = path.basename(googleServiceAccountKeyFile);
158
164
  const key = await appGoogleServiceAccountKeysService.create({
@@ -205,6 +211,11 @@ export default defineCommand({
205
211
  }
206
212
  }
207
213
  // Upload Apple API key file
214
+ const appleApiKeyFileExists = await fileExistsAtPath(appleApiKeyFile);
215
+ if (!appleApiKeyFileExists) {
216
+ consola.error(`The Apple API key file was not found or is not accessible: ${appleApiKeyFile}`);
217
+ process.exit(1);
218
+ }
208
219
  const buffer = fs.readFileSync(appleApiKeyFile);
209
220
  const fileName = path.basename(appleApiKeyFile);
210
221
  const key = await appAppleApiKeysService.create({
@@ -2,6 +2,7 @@ import appEnvironmentsService from '../../../services/app-environments.js';
2
2
  import { parseKeyValuePairs } from '../../../utils/app-environments.js';
3
3
  import { withAuth } from '../../../utils/auth.js';
4
4
  import { isInteractive } from '../../../utils/environment.js';
5
+ import { fileExistsAtPath } from '../../../utils/file.js';
5
6
  import { prompt, promptAppSelection, promptOrganizationSelection } from '../../../utils/prompt.js';
6
7
  import { defineCommand, defineOptions } from '@robingenz/zli';
7
8
  import consola from 'consola';
@@ -52,6 +53,11 @@ export default defineCommand({
52
53
  // Parse variables from inline and file
53
54
  const variablesMap = new Map();
54
55
  if (variableFile) {
56
+ const fileExists = await fileExistsAtPath(variableFile);
57
+ if (!fileExists) {
58
+ consola.error(`The variable file was not found or is not accessible: ${variableFile}`);
59
+ process.exit(1);
60
+ }
55
61
  const fileContent = await fs.promises.readFile(variableFile, 'utf-8');
56
62
  const fileVariables = parseKeyValuePairs(fileContent);
57
63
  fileVariables.forEach((v) => variablesMap.set(v.key, v.value));
@@ -64,6 +70,11 @@ export default defineCommand({
64
70
  // Parse secrets from inline and file
65
71
  const secretsMap = new Map();
66
72
  if (secretFile) {
73
+ const fileExists = await fileExistsAtPath(secretFile);
74
+ if (!fileExists) {
75
+ consola.error(`The secret file was not found or is not accessible: ${secretFile}`);
76
+ process.exit(1);
77
+ }
67
78
  const fileContent = await fs.promises.readFile(secretFile, 'utf-8');
68
79
  const fileSecrets = parseKeyValuePairs(fileContent);
69
80
  fileSecrets.forEach((s) => secretsMap.set(s.key, s.value));
@@ -8,6 +8,7 @@ import { parseKeyValuePairs } from '../../../utils/app-environments.js';
8
8
  import { withAuth } from '../../../utils/auth.js';
9
9
  import { parseCustomProperties } from '../../../utils/custom-properties.js';
10
10
  import { isInteractive } from '../../../utils/environment.js';
11
+ import { fileExistsAtPath } from '../../../utils/file.js';
11
12
  import { waitForJobCompletion } from '../../../utils/job.js';
12
13
  import { prompt, promptAppSelection, promptOrganizationSelection } from '../../../utils/prompt.js';
13
14
  import zip from '../../../utils/zip.js';
@@ -187,6 +188,11 @@ export default defineCommand({
187
188
  // Parse ad hoc environment variables from inline and file
188
189
  const variablesMap = new Map();
189
190
  if (options.variableFile) {
191
+ const fileExists = await fileExistsAtPath(options.variableFile);
192
+ if (!fileExists) {
193
+ consola.error(`The variable file was not found or is not accessible: ${options.variableFile}`);
194
+ process.exit(1);
195
+ }
190
196
  const fileContent = await fs.readFile(options.variableFile, 'utf-8');
191
197
  const fileVariables = parseKeyValuePairs(fileContent);
192
198
  fileVariables.forEach((v) => variablesMap.set(v.key, v.value));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@capawesome/cli",
3
- "version": "4.8.1",
3
+ "version": "4.8.3",
4
4
  "description": "The Capawesome Cloud Command Line Interface (CLI) to manage Live Updates and more.",
5
5
  "type": "module",
6
6
  "scripts": {