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 && ( {errorDetails && (
<div className="relative"> <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"> <pre className="text-xs whitespace-pre-wrap font-mono">
{errorDetails.message} {errorDetails.message}
</pre> </pre>

View File

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

View File

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