bcpeinhardt / simplifile

Simple file operations for Gleam that work on all targets (Erlang/Node/Deno)
71 stars 10 forks source link

Add verify_is_symlink() and create_symlink() #27

Closed slegrand45 closed 4 months ago

slegrand45 commented 5 months ago

Hello,

This is a patch proposal to add two new functions :

bcpeinhardt commented 5 months ago

Hey there! This is great, thank you! Would you mind including an entry in the changelog under the unreleased section?

bcpeinhardt commented 5 months ago

Hey there! So I checked out the PR, and some tests are failing on deno. You can run the test.sh file to verify tests pass on all targets.

slegrand45 commented 4 months ago

Hi,

Sorry for the test failing with Deno, i didn't notice the test.sh file. With Deno, it seems that you can't delete the symlink if it was created with a non existing target and if this target still doesn't exist when you try to delete the symlink. I'm not really sure about this diagnostic. All i can see is that if i create the target before trying to delete the symlink the tests are ok with Node and Deno...

Concerning Bun i only have Gleam v1.0.0 so i can't test with this runtime. Let me know if the tests are ok. If not, i will try to install the unrelease version of Gleam in order to fix the tests.

Stéphane.

bcpeinhardt commented 4 months ago

The issue wasn't deno, it was my ffi still internally using a function I had already deprecated because it would cause a crash xD So it appears to be fixed but I remain skeptical. I need a much better testing story for simplifile. I appreciate you sticking with it through that haha. You're also right about the test.sh, I probably need a contributing section in the readme which mentions it :)