thombruce / tnt

Thom's Nuxt Template
https://tnt.thombruce.com/
MIT License
1 stars 0 forks source link

[Bug]: (Linux) Issue creating new files #96

Closed thombruce closed 3 months ago

thombruce commented 3 months ago

What happened?

I encountered a bug on dev when creating a new file and the file could not be created.

No idea if the issue also exists on Windows. Requires testing and further diagnostics.

Version

0.10.x (Default)

What browsers are you seeing the problem on?

No response

Relevant log output

No response

Code of Conduct

thombruce commented 3 months ago

The issue does not exist on Windows.

This suggests it is similar to an odd discrepancy I've seen before in how Linux handles file paths compared to Windows. On Windows, we're always prepending the file paths with the PORTABLE directory env var. On Linux, this is not present and the current directory should be used by default. I must be stripping too much information from the path.

Perhaps instead of a replace operation like str.replace(ROOT, '') we ought to be doing something like str.replace(ROOT, './').

This should still work on Windows, as join() will appropriately connect the resultant path to the PORTABLE dir, but it will be a case by case usage as and where needed. For instance, it seems to be required of the createFile operation, but it is invalid as an application URL path.

thombruce commented 3 months ago

This fixes the issue on Linux: cb8a1362fdbd6ad9335a7a9d47e0b68326f187ad

I've pushed out an alpha package and alpha version of Toodles to test on Windows. I believe the join() function should handle the new paths just fine, even on Windows. We're essentially just restoring a behaviour that existed prior to the introduction of the directory tree.

thombruce commented 3 months ago

Root folder successfully created, renamed and deleted.

Nested file in said folder produces Toast but does not state correct path (was .Dummy/test.todo) and does not exist in folder (may exist elsewhere).

A case of just a / being missed, perhaps?

thombruce commented 3 months ago

Issue appears to be completely resolved as of v0.33.3-alpha.1.