twibiral/obsidian-execute-code

[BUG] seemingly trying to use \ on linux instead of / when executing something in /tmp

Closed this issue ยท 8 comments

Describe the bug
It seems that when trying to execute any language that needs to be compiled first (Python works because it doesn't need to compile from my knowledge) it is trying to access the compiled file like this /tmp(temp file number).(compiled file ending) which results in an EACCES Permission denied.

Software Version
OS: Archcraft x86_64,
Plugin Version: 1.11.1
Obsidian Version: 1.5.12-1 Edit: downloaded from the arch extra repo

To Reproduce
Steps to reproduce the behavior:

  1. create a codeblock for any compiling language like rust or java (in my example I used java)
  2. specify run-(chosen language)
  3. write simple hello world the way it works with compiler normally
  4. press run
  5. see Error while executing /usr/bin/java -ea /tmp\temp_1714979553374.java: Error: EACCES: permission denied, open '/tmp\temp_1714979553374.java'

Expected behavior
It should output hello world just like it does in python.

Screenshots
error

Additional context
if I'm just stupid and set it up wrong please inform me of it. Because I do not quite understand if this is a bug or if I did something wrong.
Sorry for any grammatically wrong sentences, English isn't my first language

Update
thanks to @He-Zu a fix was found. Thank you very much!

I am also encountering this issue.

make this change in main.js
grafik
to
grafik
then it works for me

I am also encountering this issue.

Thank you @He-Zu ๐Ÿ™

@He-Zu You made my day! Thank you ๐Ÿ™

@He-Zu Thank you this worked.

Haha I didn't notice this issue until now. I submitted a PR that should fix the same problem against issue #347

Fixed with new release version 1.12.0