diff --git a/aliases/checklinks.elv b/aliases/checklinks.elv index 4d966da..87c9ed6 100644 --- a/aliases/checklinks.elv +++ b/aliases/checklinks.elv @@ -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) } } diff --git a/aliases/pdf.elv b/aliases/pdf.elv index 9db455f..2f3ea97 100644 --- a/aliases/pdf.elv +++ b/aliases/pdf.elv @@ -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 } diff --git a/aliases/symfony.elv b/aliases/symfony.elv index a62c30c..a5196fb 100644 --- a/aliases/symfony.elv +++ b/aliases/symfony.elv @@ -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) diff --git a/rc.elv b/rc.elv index 65d54a8..ed63dff 100644 --- a/rc.elv +++ b/rc.elv @@ -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)