Pour tout problème contactez-nous par mail : support@froggit.fr | La FAQ :grey_question: | Rejoignez-nous sur le Chat :speech_balloon:

Skip to content
Snippets Groups Projects
Commit 70af724d authored by Pierre Jarriges's avatar Pierre Jarriges
Browse files

default_static->default_assets

parent 00eb79c2
No related branches found
No related tags found
No related merge requests found
File moved
File moved
File moved
File moved
File moved
...@@ -28,6 +28,8 @@ pub async fn favicon(website: web::Data<RwLock<WebSite>>) -> impl Responder { ...@@ -28,6 +28,8 @@ pub async fn favicon(website: web::Data<RwLock<WebSite>>) -> impl Responder {
) )
} }
// TODO routes for robots.txt, sitemap.xml, dyn.sitemap.xml,...
fn upload_data_from_multipart_field( fn upload_data_from_multipart_field(
field: &actix_multipart::Field, field: &actix_multipart::Field,
) -> Result<UploadFileData, String> { ) -> Result<UploadFileData, String> {
......
...@@ -57,7 +57,7 @@ impl StaticFilesManager { ...@@ -57,7 +57,7 @@ impl StaticFilesManager {
)); ));
}; };
if let Err(err) = Self::copy_default_files(&dir) { if let Err(err) = Self::copy_default_assets(&dir) {
return Err(format!( return Err(format!(
"Error copying StaticFilesManager default assets directory - {}", "Error copying StaticFilesManager default assets directory - {}",
err err
...@@ -98,14 +98,14 @@ impl StaticFilesManager { ...@@ -98,14 +98,14 @@ impl StaticFilesManager {
Ok(()) Ok(())
} }
fn copy_default_files(static_dir: &PathBuf) -> Result<(), String> { fn copy_default_assets(static_dir: &PathBuf) -> Result<(), String> {
let local_default_static = std::env::current_dir().unwrap().join("default_static"); let local_default_assets = std::env::current_dir().unwrap().join("default_assets");
let default_static = static_dir.join("assets").join("default"); let default_assets = static_dir.join("assets").join("default");
let mut cpy_options = fs_extra::dir::CopyOptions::new(); let mut cpy_options = fs_extra::dir::CopyOptions::new();
cpy_options.content_only = true; cpy_options.content_only = true;
cpy_options.overwrite = true; cpy_options.overwrite = true;
match fs_extra::dir::copy(local_default_static, default_static, &cpy_options) { match fs_extra::dir::copy(local_default_assets, default_assets, &cpy_options) {
Err(err) => Err(format!("{}", err)), Err(err) => Err(format!("{}", err)),
Ok(_) => Ok(()), Ok(_) => Ok(()),
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment