mirror of
https://github.com/rojo-rbx/rojo.git
synced 2026-10-23 05:51:39 +00:00
Refactor file path handling in JobThreadContext and ApiService
- Streamlined the logic for encoding new file names and paths, enhancing consistency in file operations across both JobThreadContext and ApiService. - Improved readability by consolidating multiple lines of code into single statements, particularly in the handling of metadata file paths and script suffixes. - Enhanced error logging for snapshot retrieval in compute_and_apply_changes, ensuring better debugging capabilities during file operations.
This commit is contained in:
parent
e33cf7ae77
commit
9912d86896
2 changed files with 17 additions and 31 deletions
|
|
@ -351,10 +351,7 @@ impl ApiService {
|
|||
// Strip known script suffixes (.server, .client, etc.)
|
||||
// rather than splitting on dots, so that names containing
|
||||
// dots (e.g. "Config.Client.server.luau") resolve correctly.
|
||||
if let Some(file_stem) = path
|
||||
.file_stem()
|
||||
.and_then(|s| s.to_str())
|
||||
{
|
||||
if let Some(file_stem) = path.file_stem().and_then(|s| s.to_str()) {
|
||||
let base_name = file_stem
|
||||
.strip_suffix(".server")
|
||||
.or_else(|| file_stem.strip_suffix(".client"))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue