Merge pull request #14327 from RandomShaper/fix-chmod-error-2.1

Fix Windows-to-Linux export error (2.1)
This commit is contained in:
Rémi Verschelde 2017-12-06 23:16:21 +01:00 committed by GitHub
commit b87cbe7994
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 1 deletions

View File

@ -139,7 +139,7 @@ public:
virtual Error reopen(const String &p_path, int p_mode_flags); ///< does not change the AccessType
virtual Error _chmod(const String &p_path, int p_mod) { return FAILED; }
virtual Error _chmod(const String &p_path, int p_mod) { return ERR_UNAVAILABLE; }
static FileAccess *create(AccessType p_access); /// Create a file access (for the current platform) this is the only portable way of accessing files.
static FileAccess *create_for_path(const String &p_path);

View File

@ -1350,6 +1350,9 @@ Error EditorExportPlatformPC::export_project(const String &p_path, bool p_debug,
int flags = get_chmod_flags();
if (flags) {
err = dst->_chmod(p_path, flags);
// If exporting from a platform with no chmod support (i.e., Windows), don't fail
if (err == ERR_UNAVAILABLE)
err = OK;
}
}