From 6b33d56c7f2f3f5ff497f6ef81199c6bdf26ec43 Mon Sep 17 00:00:00 2001 From: wackbyte Date: Sat, 16 Jul 2022 20:56:31 -0400 Subject: [PATCH] Really default to the current directory in 'rojo fmt-project' --- src/cli/fmt_project.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/cli/fmt_project.rs b/src/cli/fmt_project.rs index 9351d635f..48a52bd62 100644 --- a/src/cli/fmt_project.rs +++ b/src/cli/fmt_project.rs @@ -5,6 +5,8 @@ use clap::Parser; use crate::project::Project; +use super::resolve_path; + /// Reformat a Rojo project using the standard JSON formatting rules. #[derive(Debug, Parser)] pub struct FmtProjectCommand { @@ -15,7 +17,8 @@ pub struct FmtProjectCommand { impl FmtProjectCommand { pub fn run(self) -> anyhow::Result<()> { - let project = Project::load_fuzzy(&self.project)? + let base_path = resolve_path(&self.project); + let project = Project::load_fuzzy(&base_path)? .context("A project file is required to run 'rojo fmt-project'")?; let serialized = serde_json::to_string_pretty(&project)