chdir "$web_root"; my $repo = Git::Wrapper->new('.'); foreach my $plugin ( @plugins) { my $dir = File::Rsync->new({ exclude => $rsync_exclude, archive => 1 }); my $src = $plugin . '/'; $dir->exec({src => $src, dest => $cgi_path}) or warn "$plugin : rsync failed.\n"; say "$plugin installation was successful."; # final message before the script freezes on larger directories my $msg = "Plugin: $plugin"; chdir $web_root; $repo->add( '.') or warn "Successful git-add of $plugin \n."; $repo->commit({ all => 1, message => $msg }) or warn "Successful git committed $plugin\n"; say "commit complete"; my $output = $repo->log(); say "$output"; }