-
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: fix version with target_platform
close #18 Signed-off-by: DragonBillow <[email protected]>
- Loading branch information
Showing
9 changed files
with
237 additions
and
113 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,36 @@ | ||
use minijinja::Value; | ||
use nixpkgs_fmt::reformat_string; | ||
|
||
use crate::data_struct::TargetPlatform; | ||
|
||
pub fn nixfmt(value: &str) -> String { | ||
reformat_string(value) | ||
} | ||
|
||
pub fn to_string(value: Value) -> String { | ||
format!(r#""{value}""#) | ||
} | ||
|
||
pub fn is_universal(target_platform: String) -> bool { | ||
let target_platform: TargetPlatform = target_platform.as_str().into(); | ||
matches!(target_platform, TargetPlatform::Universal) | ||
} | ||
|
||
pub fn is_linux_x86(target_platform: String) -> bool { | ||
let target_platform: TargetPlatform = target_platform.as_str().into(); | ||
matches!(target_platform, TargetPlatform::LinuxX64) | ||
} | ||
|
||
pub fn is_linux_arm(target_platform: String) -> bool { | ||
let target_platform: TargetPlatform = target_platform.as_str().into(); | ||
matches!(target_platform, TargetPlatform::LinuxArm64) | ||
} | ||
pub fn is_darwin_x86(target_platform: String) -> bool { | ||
let target_platform: TargetPlatform = target_platform.as_str().into(); | ||
matches!(target_platform, TargetPlatform::DarwinX64) | ||
} | ||
|
||
pub fn is_darwin_arm(target_platform: String) -> bool { | ||
let target_platform: TargetPlatform = target_platform.as_str().into(); | ||
matches!(target_platform, TargetPlatform::DarwinArm64) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.