diff --git a/CHANGELOG.md b/CHANGELOG.md index d9ab7b90..5c4a1a8b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,7 @@ ## [Unreleased] * Added support for live-syncing `CollectionService` tags. * Added a warning when building binary place files, since they're still experimental and have bugs. +* Added a warning when trying to use Rojo 0.5.x with a Rojo 0.4.x-only project. * Fixed plugin live-sync not ignoring unknown properties. ## [0.5.0 Alpha 11](https://github.com/LPGhatguy/rojo/releases/tag/v0.5.0-alpha.11) (May 29, 2019) diff --git a/server/src/project.rs b/server/src/project.rs index 346158ee..5d190d0b 100644 --- a/server/src/project.rs +++ b/server/src/project.rs @@ -439,8 +439,13 @@ impl Project { } pub fn load_fuzzy(fuzzy_project_location: &Path) -> Result { - let project_path = Self::locate(fuzzy_project_location) - .ok_or(ProjectLoadFuzzyError::NotFound)?; + let project_path = match Self::locate(fuzzy_project_location) { + Some(path) => path, + None => { + Project::warn_if_4x_project_present(fuzzy_project_location); + return Err(ProjectLoadFuzzyError::NotFound); + } + }; Self::load_exact(&project_path).map_err(From::from) } @@ -485,6 +490,21 @@ impl Project { } } + /// Issues a warning if no Rojo 0.5.x project is found, but there's a legacy + /// 0.4.x project in the directory. + fn warn_if_4x_project_present(folder: &Path) { + let file_path = folder.join("rojo.json"); + + if fs::metadata(file_path).is_ok() { + warn!("No Rojo 0.5 project file was found, but a Rojo 0.4 project was."); + warn!("Rojo 0.5.x uses 'default.project.json' files"); + warn!("Rojo 0.5.x uses 'rojo.json' files"); + warn!(""); + warn!("For help upgrading, see:"); + warn!("https://lpghatguy.github.io/rojo/guide/migrating-to-epiphany/"); + } + } + pub fn folder_location(&self) -> &Path { self.file_location.parent().unwrap() } diff --git a/test-projects/legacy/rojo.json b/test-projects/legacy/rojo.json new file mode 100644 index 00000000..547d3943 --- /dev/null +++ b/test-projects/legacy/rojo.json @@ -0,0 +1,4 @@ +{ + "name": "legacy", + "parittions": {} +} \ No newline at end of file