From 817650ded9a03332f697659bdb9fd09a447911aa Mon Sep 17 00:00:00 2001 From: Benjamin VAUDOUR Date: Sat, 2 Mar 2024 15:15:47 +0100 Subject: [PATCH] =?UTF-8?q?Ajout=20de=20l=E2=80=99alias=20trdsql=20+=20r?= =?UTF-8?q?=C3=A9utilisation=20de=20wget2=20+=20limitation=20du=20nombre?= =?UTF-8?q?=20d=E2=80=99archives=20cr=C3=A9ables=20en=20simultan=C3=A9=20(?= =?UTF-8?q?nouveaut=C3=A9=20Elvish=200.20.x)=20+=20utilisation=20de=20rg?= =?UTF-8?q?=20=C3=A0=20la=20place=20de=20grep=20+=20utilisation=20du=20bui?= =?UTF-8?q?ltin=20de=20Elvish=20(nouveaut=C3=A9=20Elvish=200.20.x)=20pour?= =?UTF-8?q?=20les=20suppressions/cr=C3=A9ations=20de=20fichiers/r=C3=A9per?= =?UTF-8?q?toires?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- aliases/aliases.elv | 2 +- aliases/arc.elv | 2 +- aliases/carapace.elv | 15 --------------- aliases/pacmanhisto.elv | 2 +- aliases/pdf.elv | 11 ++++++----- aliases/tnef.elv | 11 ++++++----- aliases/{youtube-dl.elv => yt-dlp.elv} | 0 7 files changed, 15 insertions(+), 28 deletions(-) delete mode 100644 aliases/carapace.elv rename aliases/{youtube-dl.elv => yt-dlp.elv} (100%) diff --git a/aliases/aliases.elv b/aliases/aliases.elv index 74fc1ab..2893e71 100644 --- a/aliases/aliases.elv +++ b/aliases/aliases.elv @@ -23,4 +23,4 @@ edit:add-var trdsql~ {|@argv| e:trdsql -ih -id ';' -omd $@argv } #edit:add-var tree~ {|@argv| e:tree -puhC --dirsfirst --du -D $@argv } edit:add-var tree~ $-erd~ edit:add-var ungron~ {|@argv| e:gron --ungron $@argv } -#edit:add-var wget~ {|@argv| e:wget2 $@argv } +edit:add-var wget~ {|@argv| e:wget2 $@argv } diff --git a/aliases/arc.elv b/aliases/arc.elv index 6502807..9ee61f2 100644 --- a/aliases/arc.elv +++ b/aliases/arc.elv @@ -27,7 +27,7 @@ edit:add-var archiver~ {|@argv| if (== (count $argv) 0) { $help } - peach {|f| + peach &num-workers=3 {|f| var ff = (str:trim-suffix $f '/') $cmd archive $ff'.tar.'$format $ff printf "'%s' archivé\n" $ff diff --git a/aliases/carapace.elv b/aliases/carapace.elv deleted file mode 100644 index f13866e..0000000 --- a/aliases/carapace.elv +++ /dev/null @@ -1,15 +0,0 @@ -edit:add-var maj-carapace~ {|| - use path - var cur = (pwd) - var wd = $E:HOME/Documents/OtherGo/github.com/rsteube/carapace-bin - var bd = $E:HOME/Go/bin - cd $wd - git pull - cd cmd/carapace - go generate ./... - go build -ldflags="-s -w" -tags release - if (path:is-regular carapace) { - mv -f carapace $bd - } - cd $cur -} diff --git a/aliases/pacmanhisto.elv b/aliases/pacmanhisto.elv index 2347e18..252bfdd 100644 --- a/aliases/pacmanhisto.elv +++ b/aliases/pacmanhisto.elv @@ -1 +1 @@ -edit:add-var pacmanhisto~ {|@argv| e:cat /var/log/pacman.log | e:grep "ALPM" | e:grep $@argv } +edit:add-var pacmanhisto~ {|@argv| e:cat /var/log/pacman.log | e:rg "ALPM" | e:rg $@argv } diff --git a/aliases/pdf.elv b/aliases/pdf.elv index 2f3ea97..cd3c90d 100644 --- a/aliases/pdf.elv +++ b/aliases/pdf.elv @@ -1,5 +1,6 @@ edit:add-var pdf~ {|action @args| use math + use os use path use re use str @@ -113,7 +114,7 @@ edit:add-var pdf~ {|action @args| pdf:cat &out=$t $@args pdf:split &size=$s $t $out } finally { - rm -f $t + os:remove-all $t } } @@ -172,7 +173,7 @@ edit:add-var pdf~ {|action @args| try { pdf:cat &out=$t $in $@sel var n = (pdf:nb-pages $t) - mkdir $out + os:mkdir $out range 1 (+ 1 $mod) | each {|m| var sel = (range 1 (+ $n 1) | each {|i| var s = (% $i $mod) @@ -182,7 +183,7 @@ edit:add-var pdf~ {|action @args| pdf:cat &out=(printf '%s/%d.pdf' $out $m) $t $sel } } finally { - rm -f $t + os:remove-all $t } } @@ -397,14 +398,14 @@ edit:add-var pdf~ {|action @args| &i=$extract-images~ ] try { - mkdir $out + os:mkdir $out str:split ',' $types | each {|t| set t = (str:to-lower $t) must-valid $t {|e| and (> (count $e) 0) (has-key $extr $e[0])} $extr[$t[0]] $in $out } } catch e { - rm -rf $out + os:remove-all $out fail $e } } diff --git a/aliases/tnef.elv b/aliases/tnef.elv index 4d4d641..861e704 100644 --- a/aliases/tnef.elv +++ b/aliases/tnef.elv @@ -1,8 +1,9 @@ edit:add-var winmail~ {|@argv| use path + use os var curdir = (pwd) - var tmpdir = (mktemp --tmpdir -d winmail-XXXXXXXX) + var tmpdir = (os:temp-dir 'winmail-*') var remove = $false var browse = $e:falkon~ var explore = $e:dolphin~ @@ -36,14 +37,14 @@ edit:add-var winmail~ {|@argv| set data = (path:abs 'winmail.dat') } - if (not (path:is-regular $data)) { + if (not (os:is-regular $data)) { fail (printf 'Le fichier %s n’existe pas.' $data) } cd $tmpdir tnef --save-body $data - if (path:is-regular message.html) { + if (os:is-regular message.html) { perl -pe 's/cid:(image(\\d{3})\.(jpe?g|png|gif))@[[:alnum:]]{8}\.[[:alnum:]]{8}/\\1/g' message.html > message2.html $browse message2.html > /dev/null 2> /dev/null } else { @@ -51,8 +52,8 @@ edit:add-var winmail~ {|@argv| } cd $curdir - rm -rf $tmpdir + os:remove-all $tmpdir if $remove { - rm $data + os:remove $data } } diff --git a/aliases/youtube-dl.elv b/aliases/yt-dlp.elv similarity index 100% rename from aliases/youtube-dl.elv rename to aliases/yt-dlp.elv