refactor: dedupe theme values and app helpers
This commit is contained in:
12
apps/apply
12
apps/apply
@@ -2,18 +2,8 @@
|
||||
|
||||
use ./common.nu *
|
||||
|
||||
def get-hostname [] {
|
||||
if $nu.os-info.name == "macos" {
|
||||
try { ^scutil --get LocalHostName | str trim } catch { ^hostname -s | str trim }
|
||||
} else {
|
||||
^hostname | str trim
|
||||
}
|
||||
}
|
||||
|
||||
def main [hostname?: string, ...rest: string] {
|
||||
let host = if ($hostname | is-empty) {
|
||||
get-hostname
|
||||
} else { $hostname }
|
||||
let host = resolve-host $hostname
|
||||
|
||||
print_info $"Applying configuration for ($host)"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user