Skip to content

Commit

Permalink
Update ExprScripts.java
Browse files Browse the repository at this point in the history
  • Loading branch information
sovdeeth committed Jan 30, 2024
1 parent 253b026 commit be6e935
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/main/java/ch/njol/skript/expressions/ExprScripts.java
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,12 @@ protected String[] get(Event event) {
@SuppressWarnings("null")
private String[] formatFiles(List<File> files) {
return files.stream()
.map(f -> noPaths ? f.getName() : f.getPath().replaceFirst(Pattern.quote(SCRIPTS_PATH), ""))
.map(f -> {
if (noPaths)
return f.getName();
String[] split = f.getPath().split(Pattern.quote(SCRIPTS_PATH), 2);
return split[split.length - 1];
})
.toArray(String[]::new);
}

Expand Down

0 comments on commit be6e935

Please sign in to comment.