Closed MinerSebas closed 4 years ago
Ah, actually, iirc, there is an existing String function dedicated for exactly this: plus_file(...)
. The implementation should probably use that, unless I'm mistaken. Good catch though!
Didn't know this function existed. Changed the Code to now use it.
@MinerSebas Great. Thanks!
When providing file_search with a non-root directory it returned an invalid path.
Example Filepath:
res://json/file.json
Code:FileSearch.search_string(".json", "res://json/")
Output:res://jsonfile.json
This happend because the output of .get_current_dir() only ends with an / when its an root like res:// or C:/ .
The code now no longer assumes that you provide a root-directory and instead checks if an / is already present, and appends it when necessary.