diff options
author | Max Hilbrunner <mhilbrunner@users.noreply.github.com> | 2018-07-18 16:20:06 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-07-18 16:20:06 +0200 |
commit | e064eea940ff1da774f81afed21bfcdd499749f4 (patch) | |
tree | 8d37d315048ea302acb2947bb61b3254faa87a3e | |
parent | d603a74c53bbcd7d5f4b542999cea5ff9db33c89 (diff) | |
parent | 70b3ef52dacc3a21ee0f1797dde69e5c35d4012c (diff) |
Merge pull request #20241 from akien-mga/export-filter-no-res
Export filters: Relax match to allow paths without leading res://
-rw-r--r-- | editor/editor_export.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/editor/editor_export.cpp b/editor/editor_export.cpp index 7739b08eff..317fffad64 100644 --- a/editor/editor_export.cpp +++ b/editor/editor_export.cpp @@ -409,6 +409,7 @@ void EditorExportPlatform::_edit_files_with_filter(DirAccess *da, const Vector<S String cur_dir = da->get_current_dir().replace("\\", "/"); if (!cur_dir.ends_with("/")) cur_dir += "/"; + String cur_dir_no_prefix = cur_dir.replace("res://", ""); Vector<String> dirs; String f; @@ -417,8 +418,10 @@ void EditorExportPlatform::_edit_files_with_filter(DirAccess *da, const Vector<S dirs.push_back(f); else { String fullpath = cur_dir + f; + // Test also against path without res:// so that filters like `file.txt` can work. + String fullpath_no_prefix = cur_dir_no_prefix + f; for (int i = 0; i < p_filters.size(); ++i) { - if (fullpath.matchn(p_filters[i])) { + if (fullpath.matchn(p_filters[i]) || fullpath_no_prefix.matchn(p_filters[i])) { if (!exclude) { r_list.insert(fullpath); } else { |