Skip to content

Commit

Permalink
Macos builds, fixed version 0.3.19 with json output enabled
Browse files Browse the repository at this point in the history
  • Loading branch information
scx1332 committed Jul 1, 2024
1 parent f305808 commit 7505c11
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -195,3 +195,7 @@ Look for help for more information. Note that currently zstd is not supported by
```
gvmkit-build --help
```

## Integration with scripts

Use --extra-json-info-path=my-output.json to save additional information about image in json format.
8 changes: 4 additions & 4 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,8 @@ struct CmdArgs {
/// Hide progress bars during operation
#[arg(help_heading = Some("Extra options"), long)]
hide_progress: bool,
#[arg(help_heading = Some("Write json info to info.json"), long)]
extra_json_info: bool,
#[arg(help_heading = Some("Write json info to specified file"), long)]
extra_json_info_path: Option<String>,
}
use tokio::fs;

Expand Down Expand Up @@ -349,9 +349,9 @@ async fn main() -> anyhow::Result<()> {
None
};
// write info to file
if cmdargs.extra_json_info {
if let Some(json_path) = &cmdargs.extra_json_info_path {
println!(" * Writing info to info.json");
let repo_info_path = PathBuf::from("info.json");
let repo_info_path = PathBuf::from(json_path);
let mut file = File::create(&repo_info_path).await?;
file.write_all(&serde_json::to_vec_pretty(&json!({
"repoInfo": &repo_info,
Expand Down

0 comments on commit 7505c11

Please sign in to comment.