Why Nostr? What is Njump?
2024-06-10 20:07:29

npub1ml…p6a8w on Nostr: commit 2ce14f3d2e8116949bc09d5e92470ae0d01a92ac Author: randymcmillan ...

commit 2ce14f3d2e8116949bc09d5e92470ae0d01a92ac
Author: randymcmillan <[email protected]>
Date: Sun May 19 15:53:12 2024 -0400

build.rs

diff --git a/build.rs b/build.rs
new file mode 100644
index 0000000..d02e678
--- /dev/null
+++ b/build.rs
@@ -0,0 +1,92 @@
+use std::process::Command;
+use std::{env, fs};
+
+use include_dir::{include_dir, Dir};
+//use std::path::Path;
+use markdown::to_html;
+
+static PROJECT_DIR: Dir<'_> = include_dir!("$CARGO_MANIFEST_DIR");
+
+fn main() -> std::io::Result<()> {
+ let _out_dir = env::var("OUT_DIR").unwrap();
+
+ Command::new("git")
+ .args(&[
+ "remote",
+ "add",
+ "gnostr-org",
+ "[email protected]:gnostr-org/nips.git",
+ ])
+ .status()
+ .unwrap();
+ Command::new("git")
+ .args(&[
+ "remote",
+ "add",
+ "upstream",
+ "[email protected]:nostr-protocol/nips.git",
+ ])
+ .status()
+ .unwrap();
+ Command::new("git")
+ .args(&["fetch", "--all"])
+ .status()
+ .unwrap();
+ Command::new("git")
+ .args(&["fetch", "--all", "--tags"])
+ .status()
+ .unwrap();
+ Command::new("git")
+ .args(&["rebase", "upstream/master"])
+ .status()
+ .unwrap();
+
+ // //pandoc README.md | sed 's/.md/.html/g' > readme.html
+ //
+ // let mut count: u8 = 0;
+ // let glob = "**/*.md";
+ // let mut nip_vec = Vec::<String>::new(); // Create an empty Vec
+ //
+ // for entry in PROJECT_DIR.find(glob).unwrap() {
+ // count = count + 1;
+ // //println!("count={}", count);
+ // //println!("{}", entry.path().display());
+ // nip_vec.push((entry.path().display()).to_string().replace(".md",
+ // ".html")); //nip_vec.push("md content".to_string());
+ // let mut md_content = PROJECT_DIR.get_file(entry.path()).unwrap();
+ // let content = md_content.contents_utf8().unwrap();
+
+ // Get the script name (replace "my_script.sh" with the actual script name)
+ let script_name = "./script.sh";
+
+ // Build the command
+ let mut _command = Command::new(script_name);
+
+ // Add arguments if needed (optional)
+ // command.arg("argument1");
+ // command.arg("argument2");
+
+ Command::new(script_name)
+ .current_dir(".")
+ .spawn()
+ .expect("script.sh command failed to start");
+
+ // // Execute the script
+ // match command.spawn() {
+ // Ok(mut child) => {
+ // // Wait for the script to finish
+ // child.wait().expect("script failed to run");
+ // println!("Script finished successfully!");
+ // }
+ // Err(err) => {
+ // println!("Error running script: {}", err);
+ // }
+ // }
+
+ //println!("\n{}", content);
+ //println!("{}", markdown::to_html(content));
+ //let content_html = markdown::to_html(content);
+ //fs::write(format!("{}.html", count), content_html)?;
+ //}
+ Ok(())
+}
Author Public Key
npub1ml9vmt5amls8hceqknn5c6sahysu7txap8saln4g965jazg45scq8p6a8w