Skip to content
This repository was archived by the owner on Jan 24, 2025. It is now read-only.

Commit 40da74c

Browse files
committed
File path issues fixed
1 parent 2924534 commit 40da74c

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

main.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ export default class PythonScripterPlugin extends Plugin {
6868
if (local_current_file_path === undefined) {
6969
local_current_file_path = "";
7070
}
71-
exec(`python ${filePath} ${basePath} ${local_current_file_path.replace(/ /g, '\\ ')}`, {cwd: this.pythonDirectory}, (error: any, stdout: any, stderr: any) => {
71+
exec(`python ${filePath} ${basePath} \"${local_current_file_path}\"`, {cwd: this.pythonDirectory}, (error: any, stdout: any, stderr: any) => {
7272
if (error) {
7373
new Notice(`Error executing script ${filePath}: ${error}`);
7474
return;
@@ -82,13 +82,11 @@ export default class PythonScripterPlugin extends Plugin {
8282
if (local_current_file_path === undefined) {
8383
local_current_file_path = "";
8484
}
85-
console.log(`python ${filePath} ${basePath} ${local_current_file_path.replace(/ /g, '\\ ')}`)
86-
exec(`python ${path.join(filePath, "src", "main.py")} ${basePath} ${local_current_file_path.replace(/ /g, '\\ ')}`, {cwd: dir}, (error: any, stdout: any, stderr: any) => {
85+
exec(`python ${path.join(filePath, "src", "main.py")} ${basePath} \"${local_current_file_path}\"`, {cwd: dir}, (error: any, stdout: any, stderr: any) => {
8786
if (error) {
8887
new Notice(`Error executing folder program: ${error}`);
8988
return;
9089
}
91-
new Notice(`output:\n${local_current_file_path}`);
9290
new Notice(`Script ` + fileName + " " + basePath + ` output:\n${stdout}`);
9391
});
9492
}

0 commit comments

Comments
 (0)