forked from rojo-rbx/rojo
Correct issue with default.project.json files with no name being named default after change (#917)
Co-authored-by: Kenneth Loeffler <kenloef@gmail.com>
This commit is contained in:
@@ -2,6 +2,7 @@ use std::path::PathBuf;
|
||||
|
||||
use anyhow::Context;
|
||||
use clap::Parser;
|
||||
use memofs::Vfs;
|
||||
|
||||
use crate::project::Project;
|
||||
|
||||
@@ -17,8 +18,11 @@ pub struct FmtProjectCommand {
|
||||
|
||||
impl FmtProjectCommand {
|
||||
pub fn run(self) -> anyhow::Result<()> {
|
||||
let vfs = Vfs::new_default();
|
||||
vfs.set_watch_enabled(false);
|
||||
|
||||
let base_path = resolve_path(&self.project);
|
||||
let project = Project::load_fuzzy(&base_path)?
|
||||
let project = Project::load_fuzzy(&vfs, &base_path)?
|
||||
.context("A project file is required to run 'rojo fmt-project'")?;
|
||||
|
||||
let serialized = serde_json::to_string_pretty(&project)
|
||||
|
||||
Reference in New Issue
Block a user