Skript

Skript

743k Downloads

Skript does not properly handle scripts in disabled folders.

sovdeeth opened this issue · 1 comments

commented

Skript/Server Version

[17:15:21 INFO]: [Skript] Skript's aliases can be found here: https://github.com/SkriptLang/skript-aliases
[17:15:21 INFO]: [Skript] Skript's documentation can be found here: https://docs.skriptlang.org/
[17:15:21 INFO]: [Skript] Skript's tutorials can be found here: https://docs.skriptlang.org/tutorials
[17:15:21 INFO]: [Skript] Server Version: git-Paper-390 (MC: 1.20.4)
[17:15:21 INFO]: [Skript] Skript Version: 2.8.0 (selfbuilt-unknown)
[17:15:21 INFO]: [Skript] Installed Skript Addons:
[17:15:21 INFO]: [Skript]  - skript-reflect v2.4 (https://github.com/SkriptLang/skript-reflect)
[17:15:21 INFO]: [Skript] Installed dependencies: None

Bug Description

As discussed on discord, Skript struggles to identify scripts that are in disabled folders (starting with "-") as disabled unless the files themselves start with -. It also identifies folders that start with "-" as disabled files themselves.
There's also strange behavior when attempting to enable/disable files in a disabled folder. I have not tested enough to pin down the exact behavior.

Expected Behavior

Skript should enable/disable exactly what it is told to. If I /sk disable folder/, it should name the folder -folder and leave the files inside.
If I try to enable a file in a disabled folder, it should error.
If I disable a script within a folder, only that script should be disabled.

This will change behavior, but I think it's a more consistent end result.

In addition, the reporting of disabled scripts needs to be more exact. Scripts without "-" in disabled folders should still be reported, and the folders themselves should not be reported as scripts.

Steps to Reproduce

Create a folder "-directory" in /scripts/.
Create "test.sk" within it.
Create "-test2.sk" within it.

Run !send disabled scripts

You should see the following, notably lacking test.sk.

[17:23:24 INFO]: -directory
[17:23:24 INFO]: -directory\-test2.sk

Errors or Screenshots

No response

Other

No response

Agreement

  • I have read the guidelines above and affirm I am following them with this report.
commented

I remember I had made this PR already but when I checked I saw my tries 3 years ago to fix it but idk why I never finished it 😬
Pickle feel free to take over the code if it helps you