Skip to content

Commit

Permalink
fix github CI hanging on version check
Browse files Browse the repository at this point in the history
  • Loading branch information
fredclausen committed Apr 23, 2024
1 parent 48c0658 commit c9d1998
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
2 changes: 1 addition & 1 deletion rootfs/rename_current_arch_binary.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ set -x
ls -la /opt/

# determine which binary to keep
if /opt/sdre-hub.amd64 --version; then
if /opt/sdre-hub.amd64 --version > /dev/null 2>&1; then
mv -v /opt/sdre-hub.amd64 /opt/sdre-hub
elif /opt/sdre-hub.arm64 --version > /dev/null 2>&1; then
mv -v /opt/sdre-hub.arm64 /opt/sdre-hub
Expand Down
10 changes: 10 additions & 0 deletions src/bin/sdre-hub/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,16 @@ use std::error::Error;

#[tokio::main]
async fn main() -> Result<(), Box<dyn Error>> {
// Check the command line args and see if `--version` was passed.
// If so, print version and exit 0

if std::env::args().any(|x| x == *"--version") {
// get the version from the Cargo.toml file
let version = env!("CARGO_PKG_VERSION");
println!("SDRE Hub version: {version}");
return Ok(());
}

let config = ShConfig::new();
let hub = SdreHub::new(config);

Expand Down

0 comments on commit c9d1998

Please sign in to comment.