aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOndřej Čertík <ondrej@certik.us>2020-01-18 07:23:02 -0700
committerGitHub <noreply@github.com>2020-01-18 07:23:02 -0700
commit494fdda13db2944bda8e8c7e92ace6b65d448204 (patch)
tree20f67c80359f92d941541412407c29351e6aba40
parentad47216794bb0f87fd7676c724e3d6779142d983 (diff)
parent37303524fa85e75db315097a7c27e2564852af6e (diff)
downloadfpm-494fdda13db2944bda8e8c7e92ace6b65d448204.tar.gz
fpm-494fdda13db2944bda8e8c7e92ace6b65d448204.zip
Merge pull request #22 from certik/toml
Parse fpm.toml
-rw-r--r--Cargo.toml1
-rw-r--r--src/main.rs5
-rw-r--r--tests/1/fpm.toml2
-rw-r--r--tests/2/fpm.toml2
4 files changed, 10 insertions, 0 deletions
diff --git a/Cargo.toml b/Cargo.toml
index 094a80f..8baaf30 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -8,6 +8,7 @@ edition = "2018"
[dependencies]
structopt = "0.3.7"
+toml = "0.5"
[dev-dependencies]
assert_cmd = "0.10"
diff --git a/src/main.rs b/src/main.rs
index 35dde13..3fa2917 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -1,4 +1,5 @@
use structopt::StructOpt;
+use toml::Value;
#[derive(Debug, StructOpt)]
struct Cli {
@@ -25,6 +26,10 @@ fn collect_source_files() -> Vec<String> {
}
fn build() {
+ let value = std::fs::read_to_string("fpm.toml")
+ .unwrap()
+ .parse::<Value>().unwrap();
+ println!("TOML: {:?}", value);
let files = collect_source_files();
let mut files2: String = String::new();
for file in &files {
diff --git a/tests/1/fpm.toml b/tests/1/fpm.toml
new file mode 100644
index 0000000..c7d48a4
--- /dev/null
+++ b/tests/1/fpm.toml
@@ -0,0 +1,2 @@
+[dependencies]
+a = "4.0.0"
diff --git a/tests/2/fpm.toml b/tests/2/fpm.toml
new file mode 100644
index 0000000..c7d48a4
--- /dev/null
+++ b/tests/2/fpm.toml
@@ -0,0 +1,2 @@
+[dependencies]
+a = "4.0.0"