Commit ac3c5c39 authored by Julian Sparber's avatar Julian Sparber
Browse files

add return value to test if it works correctly

parent 8ca57a4d
......@@ -10,8 +10,12 @@ use rsvg::HandleExt;
use std::fs::create_dir;
use std::fs::remove_dir;
use std::fs::File;
use std::io::BufReader;
use std::io::prelude::*;
use std::error::Error;
fn main() {
fn main() -> Result<(), Box<Error>> {
let mut verbose = false;
let mut enable_cleaner = true;
let mut output_path = String::from("./output");
......@@ -42,6 +46,13 @@ fn main() {
let file_path = format!("{}/{}", output_path, path);
render_icon(&path, &file_path);
println!("The generated: {}", file_path);
let file = File::open(file_path).unwrap();
let mut buf_reader = BufReader::new(file);
let mut contents = String::new();
buf_reader.read_to_string(&mut contents).unwrap();
let works = contents.contains("data:image/png;base64");
println!("Does it work export as svg? {}", !works);
::std::process::exit(works as i32);
fn render_icon(path: &str, filename: &str) {
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment