Show name of project when starting server

This commit is contained in:
Lucien Greathouse
2018-04-22 17:19:21 -07:00
parent f215df891c
commit 3661d0daec
2 changed files with 12 additions and 11 deletions

View File

@@ -2,6 +2,7 @@
## Current Master
* Fixed server to notice file changes *much* more quickly. (200ms vs 1000ms)
* Server now lists name of project when starting up.
* Rojo now throws an error if no project file is found. ([#63](https://github.com/LPGhatguy/rojo/issues/63))
* Fixed multiple sync operations occuring at the same time. ([#61](https://github.com/LPGhatguy/rojo/issues/61))
* Partitions targeting files directly now work as expected. ([#57](https://github.com/LPGhatguy/rojo/issues/57))

View File

@@ -15,9 +15,9 @@ pub fn serve(project_path: &PathBuf, verbose: bool, port: Option<u64>) {
let server_id = rand::random::<u64>();
let project = match Project::load(project_path) {
Ok(v) => {
println!("Using project from {}", project_path.display());
v
Ok(project) => {
println!("Using project \"{}\" from {}", project.name, project_path.display());
project
},
Err(err) => {
match err {
@@ -44,12 +44,6 @@ pub fn serve(project_path: &PathBuf, verbose: bool, port: Option<u64>) {
},
};
let web_config = web::WebConfig {
verbose,
port: port.unwrap_or(project.serve_port),
server_id,
};
lazy_static! {
static ref PLUGIN_CHAIN: PluginChain = PluginChain::new(vec![
Box::new(ScriptPlugin::new()),
@@ -78,8 +72,6 @@ pub fn serve(project_path: &PathBuf, verbose: bool, port: Option<u64>) {
Arc::new(Mutex::new(vfs))
};
println!("Server listening on port {}", web_config.port);
{
let vfs = vfs.clone();
thread::spawn(move || {
@@ -87,5 +79,13 @@ pub fn serve(project_path: &PathBuf, verbose: bool, port: Option<u64>) {
});
}
let web_config = web::WebConfig {
verbose,
port: port.unwrap_or(project.serve_port),
server_id,
};
println!("Server listening on port {}", web_config.port);
web::start(web_config, project.clone(), &PLUGIN_CHAIN, vfs.clone());
}