Compatibilité elvish 0.18 + hack starship en attendant que cela soit corrigé

This commit is contained in:
Benjamin VAUDOUR 2022-03-20 18:29:23 +01:00
parent d178c54603
commit f68d1a89ce
4 changed files with 11 additions and 8 deletions

View File

@ -4,10 +4,10 @@ fn -check {|f|
use str
var @missings = (try {
sudo ldd $f 2>/dev/null | grep 'not found' | eawk {|_ m @_| put $m }
} except e {
} catch e {
})
if (> (count $missings) 1) {
var p = (LC_ALL=C pacman -Qo $f)
var p = (tmp E:LC_ALL = C; pacman -Qo $f)
printf "%s seem broken: missing %s\n" $p (str:join ', ' $missings)
}
}

View File

@ -403,7 +403,7 @@ edit:add-var pdf~ {|action @args|
must-valid $t {|e| and (> (count $e) 0) (has-key $extr $e[0])}
$extr[$t[0]] $in $out
}
} except e {
} catch e {
rm -rf $out
fail $e
}

View File

@ -3,11 +3,11 @@ edit:add-var maj-symfony~ {|@argv|
var bin = /usr/local/bin/symfony
var tmp = (mktemp -u /tmp/symfony.XXXXXXXX)
var cdir = (pwd)
fn lastVersion {||
try {
curl -s (printf 'https://api.github.com/repos/%s/releases/latest' $repo) | grep 'tag_name' | awk '{print substr($2, 3, length($2)-4) }'
} except e {
} catch e {
fail 'Impossible de récupérer les infos sur la dernière version'
}
}
@ -23,7 +23,7 @@ edit:add-var maj-symfony~ {|@argv|
#wget -O symfony.tar.gz (printf 'https://github.com/%s/archive/refs/tags/v%s.tar.gz' $repo $version)
wget -O symfony.tar.gz (printf 'https://github.com/%s/releases/download/v%s/symfony-cli_linux_amd64.tar.gz' $repo $version)
tar -xzf symfony.tar.gz
} except e {
} catch e {
cd $cdir
rm -rf $tmp
fail (printf 'Impossible de récupérer symfony %s' $version)

7
rc.elv
View File

@ -23,8 +23,11 @@ set edit:insert:binding[Ctrl-H] = $edit:histlist:start~
#set edit:rprompt = { nop }
# Starship prompt: https://starship.rs/
eval (starship init elvish)
#eval (starship init elvish --print-full-init | upgrade-scripts-for-0.17 -lambda | slurp)
#eval (starship init elvish)
{
use re
eval (re:replace 'except' 'catch' (starship init elvish --print-full-init | slurp))
}
# Carapace completion: https://github.com/rsteube/carapace-bin
eval (carapace _carapace|slurp)