Added expansion of hosts list.

This commit is contained in:
Alexandr Bogomyakov
2023-06-20 02:44:54 +03:00
parent a0e7c932ba
commit af0c005b92
2 changed files with 18 additions and 14 deletions

View File

@ -23,11 +23,16 @@ jobs:
uses: gmiam/rust-musl-action@master
with:
args: cargo build --target $BUILD_TARGET --release
- uses: actions/upload-artifact@v2
name: Upload artifact
with:
name: ${{ env.BINARY_NAME }}
path: target/x86_64-unknown-linux-musl/release/${{ env.BINARY_NAME }}*
- uses: ncipollo/release-action@v1
with:
artifacts: target/x86_64-unknown-linux-musl/release/${{ env.BINARY_NAME }}*
release:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/upload-artifact@v2
name: Upload artifact
with:
name: ${{ env.BINARY_NAME }}
path: target/x86_64-unknown-linux-musl/release/${{ env.BINARY_NAME }}*
- uses: ncipollo/release-action@v1
with:
artifacts: target/x86_64-unknown-linux-musl/release/${{ env.BINARY_NAME }}*

View File

@ -174,12 +174,11 @@ fn main() {
.collect::<Vec<_>>()[0]
.to_string();
let ip = ip.parse::<IpAddr>().unwrap();
//let ip = hosts_and_ips.get(&ip).unwrap_or(&"Couldn't parse IP".yellow().bold().to_string());
info!(
"{}",
hosts_and_ips
.get(&ip)
.unwrap_or(&"Couldn't parse IP".yellow().bold().to_string())
.unwrap_or(&"Couldn't parse IP".to_string()).to_string().yellow().bold().to_string()
);
let output = match result {
Ok(output) => output,
@ -189,13 +188,13 @@ fn main() {
}
};
if output.exit_status == 0 {
info!("Code {}", output.exit_status.to_string().green());
println!("Code {}", output.exit_status);
} else {
info!("Code {}", output.exit_status.to_string().red());
error!("Code {}", output.exit_status);
};
if !args.code {
info!("STDOUT:\n{}", String::from_utf8(output.stdout).unwrap());
info!("STDERR:\n{}", String::from_utf8(output.stderr).unwrap());
println!("STDOUT:\n{}", String::from_utf8(output.stdout).unwrap());
println!("STDERR:\n{}", String::from_utf8(output.stderr).unwrap());
}
}
} else {