@codesys/mcp-toolkit 1.0.4 → 1.0.5
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/dist/codesys_interop.js +6 -11
- package/package.json +1 -1
package/dist/codesys_interop.js
CHANGED
|
@@ -81,18 +81,13 @@ function executeCodesysScript(scriptContent, codesysExePath, codesysProfileName)
|
|
|
81
81
|
process.stderr.write(`Temporary script written to: ${tempFilePath} with latin1 encoding and LF line endings\n`); // Use process.stderr
|
|
82
82
|
// Add --additionalfolder argument
|
|
83
83
|
const additionalFolderPath = "C:\\Program Files\\CODESYS 3.5.21.0\\CODESYS\\AdditionalFolders\\Default"; // Assuming Default instance
|
|
84
|
-
// Fix: Use shell:
|
|
85
|
-
const
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
`--runscript=${tempFilePath}`
|
|
90
|
-
];
|
|
91
|
-
process.stderr.write(`Executing: ${command} ${args.join(' ')}\n`); // Log the command
|
|
92
|
-
// Spawn the CODESYS process using shell:false for proper path handling with spaces
|
|
93
|
-
const codesysProcess = (0, child_process_1.spawn)(command, args, {
|
|
84
|
+
// Fix: Use shell:true but ensure proper quoting for paths with spaces
|
|
85
|
+
const commandWithArgs = `"${codesysExePath}" --profile="${codesysProfileName}" --noUI --runscript="${tempFilePath}"`;
|
|
86
|
+
process.stderr.write(`Executing: ${commandWithArgs}\n`); // Log the command
|
|
87
|
+
// Spawn the CODESYS process with shell:true for compatibility with CODESYS argument parsing
|
|
88
|
+
const codesysProcess = (0, child_process_1.spawn)(commandWithArgs, {
|
|
94
89
|
stdio: ['ignore', 'pipe', 'pipe'], // Ignore stdin, pipe stdout and stderr
|
|
95
|
-
shell:
|
|
90
|
+
shell: true // Keep shell:true but with properly quoted paths
|
|
96
91
|
});
|
|
97
92
|
// Capture stdout
|
|
98
93
|
codesysProcess.stdout.on('data', (data) => {
|