react-native-email-imap-smtp 0.3.12 → 0.3.13

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/server/bin.mjs +6 -2
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-email-imap-smtp",
3
- "version": "0.3.12",
3
+ "version": "0.3.13",
4
4
  "description": "The best of imap and smtp client of react native",
5
5
  "main": "./lib/module/index.js",
6
6
  "types": "./lib/typescript/src/index.d.ts",
package/server/bin.mjs CHANGED
@@ -57,8 +57,12 @@ if (openWindow && !foreground) {
57
57
  const termPid = process.ppid;
58
58
 
59
59
  if (process.platform === 'win32') {
60
- const cmd = `start "Email Proxy :${port}" cmd /c "set PROXY_WATCH_PPID=${termPid}&& \\"${nodeExe}\\" \\"${scriptPath}\\" --foreground --port ${port}"`;
61
- spawn('cmd', ['/c', cmd], { stdio: 'ignore', detached: true, windowsHide: false }).unref();
60
+ // 通过 spawn env 传递 PROXY_WATCH_PPID,避免 cmd.exe 引号转义问题
61
+ spawn('cmd', ['/c', 'start', `"Email Proxy :${port}"`, 'cmd', '/c',
62
+ `"${nodeExe}" "${scriptPath}" --foreground --port ${port}`], {
63
+ stdio: 'ignore', detached: true, windowsHide: false,
64
+ env: { ...process.env, PROXY_WATCH_PPID: String(termPid) }
65
+ }).unref();
62
66
  } else {
63
67
  spawn('open', ['-a', 'Terminal', scriptPath, '--args', '--foreground', `--port=${port}`], {
64
68
  stdio: 'ignore', detached: true,