Skip to content

Commit

Permalink
Include default config in build (#18)
Browse files Browse the repository at this point in the history
* read config at build time

* 0.3.1
  • Loading branch information
mertd authored Apr 18, 2022
1 parent 0ea0fd8 commit 39195ec
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "topclean"
version = "0.3.0"
version = "0.3.1"
edition = "2021"

[dependencies]
Expand Down
File renamed without changes.
3 changes: 1 addition & 2 deletions src/main.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
use std::io::{self, Write};
use std::process::{Command, Output};
use serde_derive::{Deserialize};
use std::fs;
use clap::Parser;

const PREFIX: &str = "[topclean]";
Expand Down Expand Up @@ -54,7 +53,7 @@ impl App {

fn run(run_interactive: bool) -> bool {
println!("{} Starting!", PREFIX);
let config: Config = toml::from_str(&fs::read_to_string("config.toml").unwrap()).unwrap();
let config: Config = toml::from_str(include_str!("config.toml")).unwrap();
for app in config.apps {
if !run_interactive && app.interactive {
println!("{} Skipping {}", PREFIX, app.name);
Expand Down

0 comments on commit 39195ec

Please sign in to comment.