Skip to content

Commit 5141e36

Browse files
committed
fix(deps): fix package.json support
Also fix debug build.
1 parent 2a80835 commit 5141e36

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

crates/rari-cli/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ struct ServeArgs {
179179
struct BuildArgs {
180180
#[arg(short, long, help = "Build only content <FILES>")]
181181
files: Vec<PathBuf>,
182-
#[arg(short, long, help = "Build only content listed in <FILE_LIST>")]
182+
#[arg(long, help = "Build only content listed in <FILE_LIST>")]
183183
file_list: Option<PathBuf>,
184184
#[arg(short, long, help = "Abort build on warnings")]
185185
deny_warnings: bool,

crates/rari-types/src/settings.rs

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,12 +33,13 @@ impl Deps {
3333
if let Some(package_json) =
3434
std::env::var_os("DEPS_PACKAGE_JSON").or_else(|| std::env::var_os("deps_package_json"))
3535
{
36+
println!("{package_json:?}");
3637
let path = Path::new(&package_json);
37-
if let Some(deps) = fs::read_to_string(path)
38-
.ok()
39-
.and_then(|json_str| serde_json::from_str(&json_str).ok())
40-
{
41-
return Ok(deps);
38+
if let Some(deps_json) = fs::read_to_string(path).ok().and_then(|json_str| {
39+
let s = serde_json::from_str::<DepsPackageJson>(&json_str);
40+
s.ok()
41+
}) {
42+
return Ok(deps_json.dependencies);
4243
} else {
4344
tracing::error!("unable to parse {}", path.display());
4445
}

0 commit comments

Comments
 (0)