Capacitor command fix (#498)

This commit is contained in:
Will Chen
2025-06-25 16:45:49 -07:00
committed by GitHub
parent a985a5aadf
commit d5307a7207
3 changed files with 8 additions and 1 deletions

View File

@@ -209,7 +209,7 @@ export function CapacitorControls({ appId }: CapacitorControlsProps) {
{errorDetails && (
<div className="relative">
<div className="max-h-[50vh] w-full rounded border p-4 bg-gray-50 dark:bg-gray-900 overflow-y-auto">
<div className="max-h-[50vh] w-full max-w-md rounded border p-4 bg-gray-50 dark:bg-gray-900 overflow-y-auto">
<pre className="text-xs whitespace-pre-wrap font-mono">
{errorDetails.message}
</pre>

View File

@@ -66,6 +66,10 @@ export function registerCapacitorHandlers() {
cwd: appPath,
successMessage: "Capacitor sync completed successfully",
errorPrefix: "Failed to sync Capacitor",
env: {
...process.env,
LANG: "en_US.UTF-8",
},
});
},
);

View File

@@ -8,11 +8,13 @@ export async function simpleSpawn({
cwd,
successMessage,
errorPrefix,
env,
}: {
command: string;
cwd: string;
successMessage: string;
errorPrefix: string;
env?: Record<string, string>;
}): Promise<void> {
return new Promise<void>((resolve, reject) => {
logger.info(`Running: ${command}`);
@@ -20,6 +22,7 @@ export async function simpleSpawn({
cwd,
shell: true,
stdio: "pipe",
env,
});
let stdout = "";