Skip to content
This repository
Browse code

Update File::Tools with patches from sergot++

  • Loading branch information...
commit 9c4e4cf988504df4b8e6891288e9a96683293c20 1 parent 2e350d1
Tadeusz Sośnierz authored

Showing 1 changed file with 8 additions and 2 deletions. Show diff stats Hide diff stats

  1. +8 2 ext/File__Tools/lib/Shell/Command.pm
10 ext/File__Tools/lib/Shell/Command.pm
... ... @@ -1,4 +1,5 @@
1 1 module Shell::Command;
  2 +use File::Find;
2 3
3 4 sub cat(*@files) is export {
4 5 for @files -> $f {
@@ -17,12 +18,17 @@ sub eqtime($source, $dest) is export {
17 18
18 19 sub rm_f(*@files) is export {
19 20 for @files -> $f {
20   - unlink $f if $f.IO ~~ :e;
  21 + unlink $f if $f.IO.e;
21 22 }
22 23 }
23 24
24 25 sub rm_rf(*@files) is export {
25   - ???
  26 + for @files -> $path {
  27 + for find(dir => $path).map({ .Str }).reverse -> $f {
  28 + $f.IO.d ?? rmdir($f) !! unlink($f);
  29 + }
  30 + rmdir $path;
  31 + }
26 32 }
27 33
28 34 sub touch(*@files) is export {

0 comments on commit 9c4e4cf

Please sign in to comment.
Something went wrong with that request. Please try again.