From 3edfcd801ab1014ea34317ac33f2eb8ce2422154 Mon Sep 17 00:00:00 2001 From: Vincent Vanwaelscappel Date: Mon, 13 Feb 2023 11:23:44 +0100 Subject: [PATCH] wip #5725 @0.25 --- app/src/Tools.php | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/app/src/Tools.php b/app/src/Tools.php index 3b8410d..4b0a15d 100644 --- a/app/src/Tools.php +++ b/app/src/Tools.php @@ -13,10 +13,23 @@ class Tools { public static function copy($a) { foreach ($a['files'] as $from => $to) { - Files::copy($from, $to); + self::_cp($from, $to); } } + public static function lazyCopy($a) { + foreach ($a['files'] as $from => $to) { + if (file_exists($from)) { + self::_cp($from, $to); + } + } + } + + protected static function _cp($from, $to) { + Files::mkdir(dirname($to)); + Files::copyFile($from, $to); + } + protected static function _args($args, $defaults = []) { return array_merge($defaults, $args); } -- 2.39.5