Added read-only check to unpack

This commit is contained in:
LDDestroier 2019-05-23 02:16:51 -04:00 committed by GitHub
parent 856351d65b
commit 6b2d6debb0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 1 deletions

View File

@ -1094,7 +1094,9 @@ elseif mode == "unpack" then -- unpack OR upload
end
else -- regular unpack
if exists then
if fs.exists(outputPath) and (outputPath ~= inputPath) or outputPath == shell.getRunningProgram() then
if fs.isReadOnly(outputPath) then
error("Output path is read-only.")
elseif fs.exists(outputPath) and (outputPath ~= inputPath) or outputPath == shell.getRunningProgram() then
doContinue, doOverwrite = overwriteOutputPath(inputPath, outputPath, true, justOverwrite)
end
if not doContinue then