mirror of
https://github.com/rojo-rbx/rojo.git
synced 2026-10-22 13:21:38 +00:00
Simplify and collapse some code from 'rojo serve'
This commit is contained in:
parent
f52f43fe90
commit
78a1c658d8
1 changed files with 3 additions and 17 deletions
|
|
@ -14,7 +14,7 @@ pub fn serve(project_path: &PathBuf, verbose: bool, port: Option<u64>) {
|
||||||
let server_id = rand::random::<u64>();
|
let server_id = rand::random::<u64>();
|
||||||
|
|
||||||
if verbose {
|
if verbose {
|
||||||
println!("Attempting to locate project at {}", project_path.display());
|
println!("Attempting to locate project at {}...", project_path.display());
|
||||||
}
|
}
|
||||||
|
|
||||||
let project = match Project::load(project_path) {
|
let project = match Project::load(project_path) {
|
||||||
|
|
@ -44,11 +44,10 @@ pub fn serve(project_path: &PathBuf, verbose: bool, port: Option<u64>) {
|
||||||
},
|
},
|
||||||
_ => {
|
_ => {
|
||||||
// Any other error is fine; use the default project.
|
// Any other error is fine; use the default project.
|
||||||
|
println!("Found no project file, using default project...");
|
||||||
|
Project::default()
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
println!("Found no project file, using default project...");
|
|
||||||
Project::default()
|
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -66,10 +65,6 @@ pub fn serve(project_path: &PathBuf, verbose: bool, port: Option<u64>) {
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
if verbose {
|
|
||||||
println!("Loading VFS...");
|
|
||||||
}
|
|
||||||
|
|
||||||
let vfs = {
|
let vfs = {
|
||||||
let mut vfs = VfsSession::new(&PLUGIN_CHAIN);
|
let mut vfs = VfsSession::new(&PLUGIN_CHAIN);
|
||||||
|
|
||||||
|
|
@ -84,15 +79,6 @@ pub fn serve(project_path: &PathBuf, verbose: bool, port: Option<u64>) {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
if verbose {
|
|
||||||
println!(
|
|
||||||
"Partition '{}': {} @ {}",
|
|
||||||
name,
|
|
||||||
project_partition.target,
|
|
||||||
project_partition.path
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
vfs.partitions.insert(name.clone(), path);
|
vfs.partitions.insert(name.clone(), path);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue