From ea669cbf696c6a12f61edd6bf7c31fa2b2cf1b1d Mon Sep 17 00:00:00 2001 From: Luis Daniel Lucio Quiroz Date: Wed, 22 Mar 2017 11:25:33 -0400 Subject: [PATCH] Let the apps be more self-contained regarding LUA scripts (#2440) At this moment, all LUA scripts must be at resources/install/script, this patch allows applications to be more self-contained by having app/*/resources/install/scripts directory, which it will be copied to the scripts_dir directory as well. --- app/scripts/resources/classes/scripts.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/app/scripts/resources/classes/scripts.php b/app/scripts/resources/classes/scripts.php index a4bd956e17..3d2cb6fc72 100644 --- a/app/scripts/resources/classes/scripts.php +++ b/app/scripts/resources/classes/scripts.php @@ -106,6 +106,13 @@ if (!class_exists('scripts')) { if (is_readable($dst_dir)) { recursive_copy($src_dir,$dst_dir); unset($src_dir); + + // Copy the app/*/resource/install/scripts + $app_scripts = glob($_SERVER["DOCUMENT_ROOT"].PROJECT_PATH.'app/*/resource/install/scripts'); + foreach ($app_scripts as $app_script){ + recursive_copy($app_script, $dst_dir); + } + unset($app_scripts); }else{ throw new Exception("Cannot read from '$src_dir' to get the scripts"); }