Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Really default to the current directory in 'rojo fmt-project' #581

Merged
merged 3 commits into from
Jul 18, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion src/cli/fmt_project.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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)
Expand Down