diff options
author | Danylo Hlynskyi <abcz2.uprola@gmail.com> | 2019-01-24 02:38:02 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-01-24 02:38:02 +0200 |
commit | 0abf1810668ec8df0321156b0675519610513100 (patch) | |
tree | 4b01c470bdf9f562696d965eac9316dd644fffe9 /nixos/modules/installer/tools/nixos-option.sh | |
parent | bfcfa77ba0a5ee3c45600daf186358fde7ca4908 (diff) | |
parent | a866551226a255207ee0cf39827086dbb732f0db (diff) | |
download | nixlib-0abf1810668ec8df0321156b0675519610513100.tar nixlib-0abf1810668ec8df0321156b0675519610513100.tar.gz nixlib-0abf1810668ec8df0321156b0675519610513100.tar.bz2 nixlib-0abf1810668ec8df0321156b0675519610513100.tar.lz nixlib-0abf1810668ec8df0321156b0675519610513100.tar.xz nixlib-0abf1810668ec8df0321156b0675519610513100.tar.zst nixlib-0abf1810668ec8df0321156b0675519610513100.zip |
Merge pull request #48153 from Ma27/fix-nixos-option-for-invalid-options
nixos-option: don't abort with shell failures if options are not existant
Diffstat (limited to 'nixos/modules/installer/tools/nixos-option.sh')
-rw-r--r-- | nixos/modules/installer/tools/nixos-option.sh | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/nixos/modules/installer/tools/nixos-option.sh b/nixos/modules/installer/tools/nixos-option.sh index 327e3e6989f7..4560e9c7403a 100644 --- a/nixos/modules/installer/tools/nixos-option.sh +++ b/nixos/modules/installer/tools/nixos-option.sh @@ -314,13 +314,13 @@ else # echo 1>&2 "Warning: This value is not an option." result=$(evalCfg "") - if names=$(attrNames "$result" 2> /dev/null); then + if [ ! -z "$result" ]; then + names=$(attrNames "$result" 2> /dev/null) echo 1>&2 "This attribute set contains:" escapeQuotes () { eval echo "$1"; } nixMap escapeQuotes "$names" else - echo 1>&2 "An error occurred while looking for attribute names." - echo $result + echo 1>&2 "An error occurred while looking for attribute names. Are you sure that '$option' exists?" fi fi |