Skip to content

Instantly share code, notes, and snippets.

Created August 19, 2015 16:04
Show Gist options
  • Save anonymous/5481d2e6df95b8fd5e78 to your computer and use it in GitHub Desktop.
Save anonymous/5481d2e6df95b8fd5e78 to your computer and use it in GitHub Desktop.
$ git diff
diff --git a/lib/Shell/Command.pm b/lib/Shell/Command.pm
index c3e87a0..2ca0b61 100644
--- a/lib/Shell/Command.pm
+++ b/lib/Shell/Command.pm
@@ -47,7 +47,7 @@ sub mv(*@args) is export {
sub cp($from as Str, $to as Str, :$r) is export {
if ($from.IO ~~ :d and $r) {
mkdir("$to") if $to.IO !~~ :d;
- for dir($from)».basename -> $item {
+ for dir($from).map(*.basename) -> $item {
mkdir("$to/$item") if "$from/$item".IO ~~ :d;
cp("$from/$item", "$to/$item", :r);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment