Allow tpt.beginGetScript to overwrite existing files unconditionally
It's not worth the trouble to ask questions (this was the old behaviour), the next best thing (in terms of preserving old behaviour) is to overwrite unconditionally. There is no situation in which the file name would be specified but the user wouldn't want the file to be written to.
This commit is contained in:
parent
e20312a672
commit
95b83ffd61
@ -4761,11 +4761,6 @@ void LuaScriptInterface::OnTick()
|
||||
complete({ GetScriptStatus::GetFailed{ ByteString(http::StatusText(ret)).FromUtf8() } });
|
||||
return;
|
||||
}
|
||||
if (Platform::FileExists(scriptDownloadFilename))
|
||||
{
|
||||
complete({ GetScriptStatus::GetFailed{ "File already exists" } });
|
||||
return;
|
||||
}
|
||||
if (!Platform::WriteFile(std::vector<char>(scriptData.begin(), scriptData.end()), scriptDownloadFilename))
|
||||
{
|
||||
complete({ GetScriptStatus::GetFailed{ "Unable to write to file" } });
|
||||
|
Reference in New Issue
Block a user