Compare commits

..

No commits in common. "main" and "v0.2.0" have entirely different histories.
main ... v0.2.0

4 changed files with 426 additions and 570 deletions

976
Cargo.lock generated

File diff suppressed because it is too large Load Diff

View File

@ -1,13 +1,14 @@
[package]
name = "dudo"
version = "0.2.2"
version = "0.2.0"
edition = "2021"
[dependencies]
clap = { version = "4.1.1", features = ["derive", "env"] }
handlebars = "5.1.0"
env_logger = "0.11.2"
handlebars = "4.3.1"
env_logger = "0.10.0"
log = "0.4.17"
http = "0.2.8"
serde = { version = "1.0.126", features = ["derive"] }
reqwest = { version = "0.11", features = ["json", "blocking", "rustls"] }
serde_yaml = "0.9"

View File

@ -1,4 +1,4 @@
FROM rust:1.76.0-slim-bookworm as builder
FROM rust:1.67.1-slim-buster as builder
WORKDIR /src
RUN apt-get update &&\
apt-get install -y libssl-dev gcc musl pkg-config
@ -10,8 +10,8 @@ RUN cargo build --release --jobs 2 -Z sparse-registry
FROM debian:stable
COPY --from=builder /src/target/release/dudo /bin/dudo
RUN apt-get update &&\
apt-get install -y openssl ca-certificates &&\
apt-get clean -y
apt-get install openssl ca-certificates &&\
apt-get clean
RUN chmod +x /bin/dudo
WORKDIR /workdir
ENTRYPOINT ["/bin/dudo"]

View File

@ -1,5 +1,6 @@
use clap::Parser;
use handlebars::Handlebars;
use http::StatusCode;
use log::{error, info};
use serde::{Deserialize, Serialize};
@ -118,8 +119,8 @@ fn main() {
};
info!("Running on {} {}", OS, ARCH);
let oss = config.os.get(&OS.to_string()).unwrap();
let archs = config.arch.get(&ARCH.to_string()).unwrap();
let oss = config.os.get(&OS.clone().to_string()).unwrap();
let archs = config.arch.get(&ARCH.clone().to_string()).unwrap();
for arch in archs {
for os in oss {
@ -133,7 +134,7 @@ fn main() {
let link = reg.render("download_link", &values).unwrap();
info!("Trying to download from {}", link.clone());
let mut resp = reqwest::blocking::get(link).unwrap();
if resp.status().is_success() {
if resp.status() == StatusCode::OK {
info!("Response is 200, I'll try to download");
let mut out =
File::create(args.download_path.clone()).expect("failed to create file");