Skip to content

Commit

Permalink
fix(Utils): update directory separator handling
Browse files Browse the repository at this point in the history
- Add support for Linux directory separator in Utils class.
- Ensure compatibility across Windows, Darwin, and Linux OS families.
- Default case now includes the directory separator constant for better cross-platform functionality.
  • Loading branch information
guanguans committed Oct 10, 2024
1 parent 1ea3792 commit ff80dd4
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 19 deletions.
3 changes: 2 additions & 1 deletion app/Support/Utils.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,8 @@ public static function savedPathFor(array $song, ?string $savedDir = null, strin
match (\PHP_OS_FAMILY) {
'Windows' => ['<', '>', '/', '\\', '|', ':', '"', '?', '*'],
'Darwin' => [':'],
default => [],
'Linux' => ['/'],
default => [\DIRECTORY_SEPARATOR],
},
'',
)
Expand Down
40 changes: 22 additions & 18 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit ff80dd4

Please sign in to comment.