Skip to content

Commit 68e59b5

Browse files
committed
fix: added warning message for tart clone if disk is not accessible. Added apply note for android cli. Fixed android cli emulator list
1 parent 492cd52 commit 68e59b5

5 files changed

Lines changed: 36 additions & 50 deletions

File tree

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "default",
3-
"version": "1.11.0",
3+
"version": "1.12.0-beta.4",
44
"description": "Default plugin for Codify - provides 50+ declarative resources for managing development tools and system configuration across macOS and Linux",
55
"main": "dist/index.js",
66
"scripts": {

src/resources/android/android-cli/android-cli.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ import {
99
Utils,
1010
getPty,
1111
z,
12+
CodifyCliSender,
13+
ApplyNotes,
1214
} from '@codifycli/plugin-core';
1315
import { OS } from '@codifycli/schemas';
1416
import * as fs from 'node:fs/promises';
@@ -119,6 +121,8 @@ export class AndroidCliResource extends Resource<AndroidCliConfig> {
119121
if (plan.desiredConfig.sdkPath) {
120122
await this.setSdkPath(plan.desiredConfig.sdkPath);
121123
}
124+
125+
CodifyCliSender.sendApplyNote(ApplyNotes.NEW_SHELL_REQUIRED, 'android-cli')
122126
}
123127

124128
async modify(pc: ParameterChange<AndroidCliConfig>, _plan: ModifyPlan<AndroidCliConfig>): Promise<void> {

src/resources/android/android-cli/completions/android-cli.emulators.ts

Lines changed: 4 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -2,53 +2,11 @@
22
// These correspond to profiles accepted by `android emulator create --profile=<name>`.
33
export default async function loadAndroidEmulatorProfiles(): Promise<string[]> {
44
return [
5-
// Generic form factors
5+
'large_desktop',
6+
'medium_desktop',
67
'medium_phone',
7-
'small_phone',
8-
'foldable',
98
'medium_tablet',
10-
'resizable',
11-
'desktop_medium',
12-
13-
// Pixel phones
14-
'pixel_9',
15-
'pixel_9_pro',
16-
'pixel_9_pro_xl',
17-
'pixel_9_pro_fold',
18-
'pixel_8',
19-
'pixel_8_pro',
20-
'pixel_7',
21-
'pixel_7_pro',
22-
'pixel_7a',
23-
'pixel_6',
24-
'pixel_6_pro',
25-
'pixel_6a',
26-
'pixel_5',
27-
'pixel_4',
28-
'pixel_4_xl',
29-
'pixel_4a',
30-
'pixel_3',
31-
'pixel_3_xl',
32-
'pixel_3a',
33-
'pixel_3a_xl',
34-
35-
// Pixel tablets / foldables
36-
'pixel_tablet',
37-
'pixel_fold',
38-
39-
// Wear OS
40-
'wear_os_large_round',
41-
'wear_os_small_round',
42-
'wear_os_square',
43-
'wear_os_rect',
44-
45-
// Android TV
46-
'tv_1080p',
47-
'tv_720p',
48-
'tv_4k',
49-
50-
// Automotive
51-
'automotive_1024p_landscape',
52-
'automotive_portrait',
9+
'small_desktop',
10+
'small_phone',
5311
];
5412
}

src/resources/tart/clone-parameter.ts

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,35 @@ export class TartCloneParameter extends ArrayStatefulParameter<TartConfig, TartC
1515
}
1616
}
1717

18-
async refresh(): Promise<Array<TartCloneItem> | null> {
18+
async refresh(desired: Array<TartCloneItem> | null): Promise<Array<TartCloneItem> | null> {
1919
const $ = getPty();
2020

2121
// List all available VMs in JSON format
2222
const { status, data } = await $.spawnSafe('tart list --format json', { interactive: true });
23+
24+
// A non-zero exit can mean two very different things, and exit code alone can't
25+
// distinguish them — so we parse the output:
26+
// 1. Tart isn't installed / has nothing to report -> the resource doesn't exist (null).
27+
// 2. Tart failed to *access* its storage -> a real error we must not swallow.
28+
// The most common #2 is macOS blocking access to the TART_HOME directory (e.g. an
29+
// external/removable volume without Full Disk Access), which surfaces as
30+
// "Operation not permitted" / "you don't have permission to view it" even though the
31+
// Unix permissions are fine. Silently returning null there makes Codify believe
32+
// declared VMs are missing and offer to re-clone them.
33+
const permissionDenied = /operation not permitted|don.?t have permission|permission to view/i.test(data ?? '');
34+
if (permissionDenied) {
35+
const tartHome = process.env.TART_HOME;
36+
throw new Error(
37+
`Failed to list Tart VMs — macOS denied access to Tart's storage`
38+
+ (tartHome ? ` (TART_HOME="${tartHome}")` : '')
39+
+ `.\n\n${data}\n\n`
40+
+ `If TART_HOME points at an external or removable volume, grant the app running `
41+
+ `Codify (your terminal and/or the Codify desktop app) access under System Settings `
42+
+ `→ Privacy & Security → Files and Folders (Removable Volumes) or Full Disk Access, `
43+
+ `then restart the app.`
44+
);
45+
}
46+
2347
if (status !== SpawnStatus.SUCCESS) {
2448
return null;
2549
}

0 commit comments

Comments
 (0)