Closed tlwt closed 1 month ago
I checked the change logs and they seem really minor. I have been trying to integrate PHP myself into the plugin (#263) and that error kept popping up. Could it be that Obsidian caches somewhere my own builds even when deleting the folder manually? I have not seen any similar problem reports.
I have experienced similar issue after upgrading to 1.11.1. Reverting back to 1.11.0 resolves the issue. Macbook pro 2019 (Intel) with Macos Sonoma 14.4.1 . Obsidian Version 1.5.12 (Installer 1.4.13).
The issue is caused by a hard-coded Windows file separator. I pushed a PR that resolves this issue on my 2019 Mac Pro. :)
There are other hard-coded file separators in src
, which makes me think this should also be tested on a Windows/WSL environment.
$ grep -rni '\\\\' src
src/settings/SettingsTab.ts:257: path = path.replace(/\\/g, '/');
src/transforms/Magic.ts:44: source = source.replace(VAULT_PATH_REGEX, `"${vaultPath.replace(/\\/g, "/")}"`);
src/transforms/Magic.ts:45: source = source.replace(VAULT_URL_REGEX, `"${Platform.resourcePathPrefix + vaultPath.replace(/\\/g, "/")}"`);
src/transforms/Magic.ts:46: source = source.replace(VAULT_REGEX, `"${Platform.resourcePathPrefix + vaultPath.replace(/\\/g, "/")}"`);
src/transforms/Magic.ts:60: source = source.replace(CURRENT_NOTE_PATH_REGEX, `"${notePath.replace(/\\/g, "/")}"`);
src/transforms/Magic.ts:61: source = source.replace(CURRENT_NOTE_URL_REGEX, `"${Platform.resourcePathPrefix + notePath.replace(/\\/g, "/")}"`);
src/transforms/Magic.ts:62: source = source.replace(CURRENT_NOTE_REGEX, `"${Platform.resourcePathPrefix + notePath.replace(/\\/g, "/")}"`);
src/transforms/Magic.ts:144: const tempFile = `${os.tmpdir()}/temp_${Date.now()}.png`.replace(/\\/g, "/");
src/transforms/Magic.ts:166: const image = buildMagicShowImage(imagePath.replace(/\\/g, "\\\\"), width, height, alignment);
src/transforms/Magic.ts:202: const image = buildMagicShowImage(imagePath.replace(/\\/g, "\\\\"), width, height, alignment);
src/transforms/Magic.ts:249: const tempFile = `${os.tmpdir()}/temp_${Date.now()}.png`.replace(/\\/g, "/");
src/transforms/Magic.ts:261: const tempFile = `${os.tmpdir()}/temp_${Date.now()}.png`.replace(/\\/g, "/");
src/executors/ClingExecutor.ts:52: return data.replace(new RegExp(`temp_${fileId}\\(\\)`, "g"), "main()");
src/Outputter.ts:115: text = text.replace(/\x1b\\[;\d]*m/g, "")
src/Outputter.ts:132: text = text.replace(/\x1b\\[;\d]*m/g, "")
I tested the above PR on my windows 10/WSL machine and can confirm that it works for
echo "Hello"
)console.log('Heyo')
)Fixed with new release version 1.12.0
Describe the bug Running any script in obsidian with version 1.1.1 returns the following error message with varying tmp file names:
[BUG] bash: /var/folders/mc/tr50w1s94cb27zw9_zfpcn_40000gn/Ttemp_1715179358918.sh:
. Reverting back to 1.11.0 makes script runnable again.Software Version Mac OS X 14.4.1 (23E224), Obsidian Version 1.5.12 (Installer 1.4.13), Plugin Execute Code 1.11.1 running on MacBook Pro, 13-inch, M1, 2020
To Reproduce Steps to reproduce the behavior:
ls bash: /var/folders/mc/tr50w1s94cb27zw9_zfpcn_40000gn/Ttemp_1715179637189.sh: No such file or directory