Skip to content

Commit

Permalink
show version
Browse files Browse the repository at this point in the history
  • Loading branch information
Young-Flash committed Dec 6, 2024
1 parent 6cc013a commit 7608943
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 3 deletions.
32 changes: 32 additions & 0 deletions src/util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,22 @@ fn install_unix_release(args: &[&str]) -> Result<(), MoonOpsError> {
});
}

let version_cmd = "moon version --all";
let output = std::process::Command::new("moon")
.args(["version", "--all"])
.output()
.map_err(|e| MoonOpsError {
cmd: version_cmd.to_string(),
kind: MoonOpsErrorKind::IOError(e),
})?;
if !output.status.success() {
return Err(MoonOpsError {
cmd: version_cmd.to_string(),
kind: MoonOpsErrorKind::ReturnNonZero(output.status),
});
}
println!("Version command output: {}", String::from_utf8_lossy(&output.stdout));

Ok(())
}

Expand All @@ -130,6 +146,22 @@ fn install_windows_release(is_bleeding: bool) -> Result<(), MoonOpsError> {
});
}

let version_cmd = "moon version --all";
let output = std::process::Command::new("moon")
.args(["version", "--all"])
.output()
.map_err(|e| MoonOpsError {
cmd: version_cmd.to_string(),
kind: MoonOpsErrorKind::IOError(e),
})?;
if !output.status.success() {
return Err(MoonOpsError {
cmd: version_cmd.to_string(),
kind: MoonOpsErrorKind::ReturnNonZero(output.status),
});
}
println!("Version command output: {}", String::from_utf8_lossy(&output.stdout));

Ok(())
}

Expand Down
6 changes: 3 additions & 3 deletions webapp/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -391,7 +391,7 @@ const App = () => {
</div>
{error ? (
<p className="text-red-500 text-center">{error}</p>
) : platformData.mac ? (
) : platformData.linux ? (
<div className="overflow-x-auto">
<table className="min-w-full table-auto bg-white shadow-md rounded-lg overflow-hidden">
<thead>
Expand All @@ -402,14 +402,14 @@ const App = () => {
<th colSpan={9} className="py-2 px-4 text-center bg-green-500 text-white border-r">
Stable Release
<div className="text-xs mt-1 font-normal">
{platformData.mac.stable_toolchain_version.moon_version} / moonc {platformData.mac.stable_toolchain_version.moonc_version}
{platformData.linux.stable_toolchain_version.moon_version} / moonc {platformData.linux.stable_toolchain_version.moonc_version}
</div>
</th>
<th colSpan={9} className="py-2 px-4 text-center bg-red-600 text-white relative overflow-hidden">
<span className="absolute inset-0 flex items-center justify-left text-6xl text-yellow-900 opacity-40">⚡️</span>
Bleeding Edge Release
<div className="text-xs mt-1 font-normal">
{platformData.mac.bleeding_toolchain_version.moon_version} / moonc {platformData.mac.bleeding_toolchain_version.moonc_version}
{platformData.linux.bleeding_toolchain_version.moon_version} / moonc {platformData.linux.bleeding_toolchain_version.moonc_version}
</div>
</th>
</tr>
Expand Down

0 comments on commit 7608943

Please sign in to comment.