mirror of
https://github.com/IlanCosman/tide.git
synced 2024-12-24 12:33:34 +03:00
Prevent error messages while detecting OS (#40)
* add test for file existence to avoid errors
This commit is contained in:
parent
b0982441aa
commit
f6cf2770e1
@ -17,6 +17,10 @@ function _tide_detect_os
|
|||||||
end
|
end
|
||||||
|
|
||||||
function _tide_detect_os_linux_cases -a file key
|
function _tide_detect_os_linux_cases -a file key
|
||||||
|
if not test -f $file
|
||||||
|
return 1
|
||||||
|
end
|
||||||
|
|
||||||
set -l splitOsRelease (cat $file | string split '=')
|
set -l splitOsRelease (cat $file | string split '=')
|
||||||
set -l value $splitOsRelease[(math (contains --index $key $splitOsRelease)+1)]
|
set -l value $splitOsRelease[(math (contains --index $key $splitOsRelease)+1)]
|
||||||
set -l name (string trim --chars='"' $value | string lower)
|
set -l name (string trim --chars='"' $value | string lower)
|
||||||
|
Loading…
Reference in New Issue
Block a user