pub fn add_module(modules_dir: PathBuf) -> Closure {
    closure_opt(move |mut args| {
        let module: String = Args::next("module", &mut args)?;
        let module = base64::decode(&module).map_err(|err| {
            JValue::String(format!("error decoding module from base64: {:?}", err))
        })?;
        let config = Args::next("config", &mut args)?;
        files::add_module(&modules_dir, module, config)?;

        Ok(None)
    })
}
/// Adds a module to the filesystem, overwriting existing module.
Adds a module to the filesystem, overwriting existing module.
Adds a module to the filesystem overwriting existing module .
pub fn add_module(modules_dir: PathBuf) -> Closure {
    closure_opt(move |mut args| {
        let module: String = Args::next("module", &mut args)?;
        let module = base64::decode(&module).map_err(|err| {
            JValue::String(format!("error decoding module from base64: {:?}", err))
        })?;
        let config = Args::next("config", &mut args)?;
        files::add_module(&modules_dir, module, config)?;
        Ok(None)
    })
}
pub fn add_module ( modules_dir : PathBuf ) -> Closure { closure_opt ( move | mut args | { let module : String = Args :: next ( " " , & mut args ) ? ; let module = base64 :: decode ( & module ) . map_err ( | err | { JValue :: String ( format ! ( " " err ) ) } ) ? ; let config = Args :: next ( " " , & mut args ) ? ; files :: add_module ( & modules_dir , module , config ) ? ; Ok ( None ) } ) }
Adds a module to the filesystem, overwriting existing module.
Adds a module to the filesystem overwriting existing module .
modules_dir
PathBuf