Skip to content

Commit

Permalink
fix: template not copying to cloud
Browse files Browse the repository at this point in the history
fix:
  • Loading branch information
dcdgo committed Mar 4, 2021
1 parent 40b3995 commit f82073e
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
4 changes: 3 additions & 1 deletion Rust_part/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@ FROM rust
WORKDIR /usr/vectorizer/

COPY ./Cargo.toml /usr/vectorizer/Cargo.toml
COPY ./target/release/ /usr/vectorizer
COPY ./target/release/trampoline /usr/vectorizer/trampoline
COPY ./target/release/bot /usr/vectorizer/bot
COPY ./target/release/template.svg /usr/vectorizer/template.svg

RUN apt-get update && \
apt-get dist-upgrade -y && \
Expand Down
12 changes: 10 additions & 2 deletions Rust_part/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,22 @@ const LIB_PNG: &'static str = "libpng16";
const LIB: &'static str = "lib";
const NUM_LIBS: usize = 3;

const TEMPLATE_NAME: &'static str = "template.svg";

static LIB_NAMES: [&'static str; NUM_LIBS] = [
BAD_ZLIB, GOOD_ZLIB, LIB_PNG
];

fn main() {

//copy the template svg
let _ = std::fs::copy("../template.svg", std::env::var("OUT_DIR").unwrap());
//copy the template svg

let oldtemplate = String::from("../").add(TEMPLATE_NAME);
let mut newtemplate = var("OUT_DIR").unwrap();
newtemplate = newtemplate.add("/../../../"); //fixes wtf OUT_DIR useless af
newtemplate = newtemplate.add(TEMPLATE_NAME);
println!("copying template from: {}, to: {}", &oldtemplate, &newtemplate);
let _ = copy(oldtemplate, newtemplate);

let previous_lib_path: String;
let mut new_lib_path: String;
Expand Down

0 comments on commit f82073e

Please sign in to comment.