diff --git a/src/fleen_app.rs b/src/fleen_app.rs index bde598a..7877277 100644 --- a/src/fleen_app.rs +++ b/src/fleen_app.rs @@ -84,9 +84,11 @@ impl FleenApp { fn initialize_site(root: PathBuf) -> Result<(), io::Error> { fs::create_dir(root.join("_layouts"))?; + fs::create_dir(root.join("_scripts"))?; fs::create_dir(root.join("assets"))?; fs::create_dir(root.join("images"))?; fs::write(root.join("_layouts/default.html"), include_str!("../templates/default_layout.html"))?; + fs::write(root.join("_scripts/deploy.sh"), include_str!("../templates/deploy.sh"))?; fs::write(root.join("assets/.keep"), "")?; fs::write(root.join("images/.keep"), "")?; Ok(()) @@ -100,7 +102,8 @@ impl FleenApp { fn visit_dir(dir: &Path, entries: &mut Vec) { for entry in dir.read_dir().unwrap() { let path = entry.unwrap().path(); - if path.is_file() && !path.file_name().unwrap().to_str().unwrap().starts_with('.') { + if path.file_name().unwrap().to_str().unwrap().starts_with('.') { continue } + if path.is_file() { entries.push(TreeEntry::File(path)) } else if path.is_dir() { entries.push(Dir(path.clone())); diff --git a/templates/deploy.sh b/templates/deploy.sh index c0f87cf..6eecc71 100644 --- a/templates/deploy.sh +++ b/templates/deploy.sh @@ -5,6 +5,6 @@ # stdout will be displayed in a dialog. # Example: -# rsync -r . root@example.com:/var/www/html 2>&1 && echo "Site deployed!" +# rsync -r --delete . root@example.com:/var/www/html 2>&1 && echo "Site deployed!" echo "Edit _scripts/deploy.sh to set up deploy script" \ No newline at end of file