File tree Expand file tree Collapse file tree 1 file changed +6
-0
lines changed Expand file tree Collapse file tree 1 file changed +6
-0
lines changed Original file line number Diff line number Diff line change 1212# See the License for the specific language governing permissions and
1313# limitations under the License.
1414import os
15+ import shutil
1516import tarfile
1617import tempfile
1718from pathlib import Path
3334logger = Logger (__name__ )
3435
3536_PLUGIN_MAX_CLIENT_TRIES : int = 3
37+ _PLUGIN_INTERNAL_DIR_PATH : str = f"{ os .environ .get ('HOME' , '' )} /internal"
3638
3739
3840class LightningPlugin :
@@ -169,6 +171,10 @@ def _run_plugin(run: _Run) -> Dict[str, Any]:
169171 status_code = status .HTTP_500_INTERNAL_SERVER_ERROR , detail = f"Error loading plugin: { str (ex )} ."
170172 )
171173
174+ # Allow devs to add files to the app source
175+ if os .path .isdir (_PLUGIN_INTERNAL_DIR_PATH ):
176+ shutil .copytree (_PLUGIN_INTERNAL_DIR_PATH , source_path , dirs_exist_ok = True )
177+
172178 # Ensure that apps are dispatched from the temp directory
173179 cwd = os .getcwd ()
174180 os .chdir (source_path )
You can’t perform that action at this time.
0 commit comments