mirror of
https://github.com/starship/starship.git
synced 2026-06-24 02:01:36 +07:00
style: Improve modules consistency (#3006)
* cmake - consistent parse version method names * crystal - consistent parse version method names * dart - consistent parse version method names * deno - consistent parse version method names * golang - consistent parse version method names * helm - consistent parse version method names * implement get_command_string_output, java - consistent parse version method names & small refactor * julia - consistent parse version method names * kotlin - consistent parse version method names and refactor * lua - consistent parse version method names and refactor * implement get_command_string_output for scala * format crystal module * remove outdated comment * node use format_module_version * terraform - consistent parse version method names * vagrant - consistent parse version method names * format * refactor python module * improve rlang module consistency * fix clippy warning
This commit is contained in:
@@ -32,8 +32,9 @@ pub fn module<'a>(context: &'a Context) -> Option<Module<'a>> {
|
||||
})
|
||||
.map(|variable| match variable {
|
||||
"version" => {
|
||||
let crystal_version =
|
||||
get_crystal_version(&context.exec_cmd("crystal", &["--version"])?.stdout)?;
|
||||
let crystal_version = parse_crystal_version(
|
||||
&context.exec_cmd("crystal", &["--version"])?.stdout,
|
||||
)?;
|
||||
VersionFormatter::format_module_version(
|
||||
module.get_name(),
|
||||
&crystal_version,
|
||||
@@ -57,7 +58,7 @@ pub fn module<'a>(context: &'a Context) -> Option<Module<'a>> {
|
||||
Some(module)
|
||||
}
|
||||
|
||||
fn get_crystal_version(crystal_version: &str) -> Option<String> {
|
||||
fn parse_crystal_version(crystal_version: &str) -> Option<String> {
|
||||
Some(
|
||||
crystal_version
|
||||
// split into ["Crystal", "0.35.1", ...]
|
||||
|
||||
Reference in New Issue
Block a user