summaryrefslogtreecommitdiffstats
path: root/src/modules/ocaml.rs
diff options
context:
space:
mode:
authorfilip <filipbachul@gmail.com>2021-04-29 23:22:20 +0200
committerGitHub <noreply@github.com>2021-04-29 23:22:20 +0200
commit540c2c2475571f93a7ecaf813a7832f31cc6d8be (patch)
treeec96a4a86f992d3d4c53b0471ba1121c1afb92fb /src/modules/ocaml.rs
parentc2e84e1802931197acb3eba957b78134e33cc7e8 (diff)
feat: Add version formating for modules (#2611)
* format crystal version with VersionFormatter * update crystal dosc * format crystal module * fix typos * format dart version with VersionFormatter * fix dart malformed test * update dart docs * format cmake version with VersionFormatter * update cmake docs * format deno version with VersionFormatter * update deno docs * remove Version type * format dotnet version with VersionFormatter * update dotnet docs * format erlang version with VersionFormatter * update erlang docs * format golang version with VersionFormatter * refactor formatting in my modules * format helm version with VersionFormatter * format julia version with VersionFormatter * format kotlin version with VersionFormatter * format lua version with VersionFormatter * format nim version with VersionFormatter * format perl version with VersionFormatter * format php version with VersionFormatter * format purescript version with VersionFormatter * format scala version with VersionFormatter * format swift version with VersionFormatter * format terraform version with VersionFormatter * format vagrant version with VersionFormatter * format zig version with VersionFormatter * format elixir version with VersionFormatter * format ocaml version with VersionFormatter * update elixir docs * update golang docs * update helm docs * update julia docs * update kotlin docs * update lua docs * update nim docs * update ocaml docs * update perl docs * update php docs * update purescript docs * update scala docs * update swift docs * update terraform docs * update vagrant docs * update zig docs * format elm version with VersionFormatter * update elm docs * pass module_name as &str to format_module_version
Diffstat (limited to 'src/modules/ocaml.rs')
-rw-r--r--src/modules/ocaml.rs8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/modules/ocaml.rs b/src/modules/ocaml.rs
index 634f1bd7f..6b33442e1 100644
--- a/src/modules/ocaml.rs
+++ b/src/modules/ocaml.rs
@@ -5,6 +5,7 @@ use std::path::Path;
use crate::configs::ocaml::OCamlConfig;
use crate::formatter::StringFormatter;
+use crate::formatter::VersionFormatter;
#[derive(Debug, PartialEq)]
enum SwitchType {
@@ -63,7 +64,12 @@ pub fn module<'a>(context: &'a Context) -> Option<Module<'a>> {
} else {
context.exec_cmd("ocaml", &["-vnum"])?.stdout
};
- Some(Ok(format!("v{}", &ocaml_version.trim())))
+ VersionFormatter::format_module_version(
+ module.get_name(),
+ &ocaml_version.trim(),
+ config.version_format,
+ )
+ .map(Ok)
}
_ => None,
})