Use official os-release
This commit is contained in:
@@ -1,34 +0,0 @@
|
|||||||
#!/usr/bin/env nu
|
|
||||||
|
|
||||||
def main [config: string]: nothing -> nothing {
|
|
||||||
let config = $config
|
|
||||||
| from json
|
|
||||||
| default {} properties
|
|
||||||
mut os_release = open --raw /etc/os-release
|
|
||||||
| lines
|
|
||||||
| parse '{key}={value}'
|
|
||||||
| transpose --ignore-titles -dr
|
|
||||||
| str trim -c '"'
|
|
||||||
| str trim -c "'"
|
|
||||||
print $'(ansi green)Original release:(ansi reset)'
|
|
||||||
print $os_release
|
|
||||||
|
|
||||||
for $item in ($config.properties | transpose key value) {
|
|
||||||
if $item.key in $os_release {
|
|
||||||
print $'(ansi green)Updating (ansi cyan)($item.key)(ansi green) with value (ansi yellow)($item.value)(ansi reset)'
|
|
||||||
$os_release = $os_release | update $item.key $item.value
|
|
||||||
} else {
|
|
||||||
print $'(ansi green)Adding (ansi cyan)($item.key)(ansi green) with value (ansi yellow)($item.value)(ansi reset)'
|
|
||||||
$os_release = $os_release | insert $item.key $item.value
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
print $'(ansi green)New release:(ansi reset)'
|
|
||||||
print $os_release
|
|
||||||
|
|
||||||
$os_release
|
|
||||||
| transpose key value
|
|
||||||
| each { $'($in.key)="($in.value)"' }
|
|
||||||
| str join "\n"
|
|
||||||
| save --force /etc/os-release
|
|
||||||
}
|
|
||||||
@@ -6,7 +6,6 @@ image-version: 42
|
|||||||
description: The image of Wunker OS for CP's laptop.
|
description: The image of Wunker OS for CP's laptop.
|
||||||
modules:
|
modules:
|
||||||
- type: os-release
|
- type: os-release
|
||||||
source: local
|
|
||||||
properties:
|
properties:
|
||||||
NAME: WunkerOS
|
NAME: WunkerOS
|
||||||
ID: wunker_os
|
ID: wunker_os
|
||||||
|
|||||||
@@ -21,8 +21,6 @@ nushell-version: none
|
|||||||
# ref: 605bb63a4de640b77f6d3017238ece48cb286933 # supposed fix
|
# ref: 605bb63a4de640b77f6d3017238ece48cb286933 # supposed fix
|
||||||
modules:
|
modules:
|
||||||
- type: os-release
|
- type: os-release
|
||||||
# source: local
|
|
||||||
source: ghcr.io/blue-build/modules/os-release:os-release
|
|
||||||
properties:
|
properties:
|
||||||
NAME: WunkerOS
|
NAME: WunkerOS
|
||||||
ID: wunker_os
|
ID: wunker_os
|
||||||
|
|||||||
@@ -9,7 +9,6 @@ description: The image of Wunker OS for JP's Laptop.
|
|||||||
# - from-file: common/helix.yml
|
# - from-file: common/helix.yml
|
||||||
modules:
|
modules:
|
||||||
- type: os-release
|
- type: os-release
|
||||||
source: local
|
|
||||||
properties:
|
properties:
|
||||||
NAME: WunkerOS
|
NAME: WunkerOS
|
||||||
ID: wunker_os
|
ID: wunker_os
|
||||||
|
|||||||
Reference in New Issue
Block a user