diff --git a/crates/engine/src/cmd/fileio.rs b/crates/engine/src/cmd/fileio.rs index 84fb121d0c..278182baf3 100644 --- a/crates/engine/src/cmd/fileio.rs +++ b/crates/engine/src/cmd/fileio.rs @@ -121,6 +121,7 @@ mod commands; mod export_names; mod formats; +pub(crate) use access::check_scripts_of; #[cfg(not(target_arch = "wasm32"))] pub(crate) use access::list_dir; pub use access::{check_linked_scripts, write_file_with, write_save_file, write_save_file_with}; diff --git a/crates/engine/src/cmd/fileio/access.rs b/crates/engine/src/cmd/fileio/access.rs index 203a2262b0..457448423b 100644 --- a/crates/engine/src/cmd/fileio/access.rs +++ b/crates/engine/src/cmd/fileio/access.rs @@ -121,22 +121,54 @@ pub(crate) fn naming_in_message(msg: &str, path: &str, name: &str) -> String { out } -/// The error for an SVG of a document that links a JavaScript file outside the read roots. +/// The error for a file that would name a JavaScript file the document links outside the read roots. pub(crate) const SCRIPT_OUTSIDE: &str = "a linked JavaScript file is outside the read roots"; -/// `cmd` may write `st`'s document in format `format` (a format id): any format but SVG and SVGZ, -/// and those too unless read roots are in force and the document links a JavaScript file outside -/// them (`svg_scripts`, a relative path taken from the document's folder; a URL is not checked), -/// which the file's `