add safety check to avoid infinite cat hang
This commit is contained in:
parent
b557d635fd
commit
5a7a1747f2
1 changed files with 10 additions and 8 deletions
|
@ -161,14 +161,16 @@ def fish_completion():
|
||||||
function __borgmatic_check_version
|
function __borgmatic_check_version
|
||||||
set -fx this_filename (status current-filename)
|
set -fx this_filename (status current-filename)
|
||||||
fish -c '
|
fish -c '
|
||||||
set this_script (cat $this_filename 2> /dev/null)
|
if test -f "$this_filename"
|
||||||
set installed_script (borgmatic --fish-completion 2> /dev/null)
|
set this_script (cat $this_filename 2> /dev/null)
|
||||||
if [ "$this_script" != "$installed_script" ] && [ "$installed_script" != "" ]
|
set installed_script (borgmatic --fish-completion 2> /dev/null)
|
||||||
echo "{upgrade_message(
|
if [ "$this_script" != "$installed_script" ] && [ "$installed_script" != "" ]
|
||||||
'fish',
|
echo "{upgrade_message(
|
||||||
'borgmatic --fish-completion | sudo tee $this_filename',
|
'fish',
|
||||||
'$this_filename',
|
'borgmatic --fish-completion | sudo tee $this_filename',
|
||||||
)}"
|
'$this_filename',
|
||||||
|
)}"
|
||||||
|
end
|
||||||
end
|
end
|
||||||
' &
|
' &
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue