mirror of
https://github.com/The-Powder-Toy/The-Powder-Toy.git
synced 2025-08-17 21:51:20 +02:00
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:
@@ -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