Fix related to entry_point directories creatinon in `/tmp/<uuid>` relative to `./pack/actions` directory
@@ -404,15 +404,23 @@ def clone_action_db(source_action_db, dest_pack, dest_action):
def temp_backup_action_files(pack_base_path, metadata_file, entry_point, temp_sub_dir):
temp_dir_path = "/tmp/%s" % temp_sub_dir
os.mkdir(temp_dir_path)
- os.mkdir(os.path.join(temp_dir_path, "actions"))
- os.mkdir(os.path.join(temp_dir_path, "actions", "workflows"))
+ actions_dir = os.path.join(temp_dir_path, "actions")
+ os.mkdir(actions_dir)
temp_metadata_file_path = os.path.join(temp_dir_path, metadata_file)
dest_metadata_file_path = os.path.join(pack_base_path, metadata_file)
_clone_content_to_destination_file(
source_file=dest_metadata_file_path, destination_file=temp_metadata_file_path
)
if entry_point:
- temp_entry_point_file_path = os.path.join(temp_dir_path, "actions", entry_point)
+ if os.path.split(entry_point)[0] == "":
+ temp_entry_point_file_path = os.path.join(
+ temp_dir_path, "actions", entry_point
+ )
+ else:
+ entry_point_dir = str(os.path.split(entry_point)[0])
+ entry_point_dir_path = os.path.join(actions_dir, entry_point_dir)
+ os.makedirs(entry_point_dir_path)
+ temp_entry_point_file_path = os.path.join(actions_dir, entry_point)
dest_entry_point_file_path = os.path.join(
pack_base_path, "actions", entry_point
)
