summaryrefslogtreecommitdiff
path: root/build.rs
diff options
context:
space:
mode:
Diffstat (limited to 'build.rs')
-rw-r--r--build.rs11
1 files changed, 11 insertions, 0 deletions
diff --git a/build.rs b/build.rs
new file mode 100644
index 0000000..278a7c6
--- /dev/null
+++ b/build.rs
@@ -0,0 +1,11 @@
+use std::fs::{read, write};
+use std::path::PathBuf;
+
+fn main() {
+ let py = read("cloud-init.py").unwrap();
+ let py = String::from_utf8_lossy(&py).to_string();
+
+ let mut path: PathBuf = std::env::var("OUT_DIR").unwrap().into();
+ path.push("cloud-init.rs");
+ write(&path, &format!("r#\"{}\"#\n", py)).unwrap();
+}