Skip to content

Commit e454c24

Browse files
committed
refact: api state + virt_type
1 parent cf39ed7 commit e454c24

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

‎system/cuos/api.sh‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ api_command_state() {
2727
local file_state="${T_FILE_STATE:-"/data/state.json"}"
2828
local file_slot="${T_FILE_SLOT:-"/etc/active_slot"}"
2929
local file_version="${T_FILE_VERSION:-"/etc/image"}"
30+
local virt_type="$(systemd-detect-virt)"
3031

3132
local version
3233
version="$(cat "${file_version}")"
@@ -37,7 +38,8 @@ api_command_state() {
3738
jq \
3839
--arg slot "${slot}" \
3940
--arg version "${version}" \
40-
'.slot = $slot | .version = $version' \
41+
--arg virt_type "${virt_type}" \
42+
'. + {"slot": $slot, "version": $version, "virt_type": $virt_type}' \
4143
"${file_state}"
4244
}
4345

0 commit comments

Comments
 (0)