Skip to content

Commit

Permalink
Ensure all extracted file have proper file permissions
Browse files Browse the repository at this point in the history
  • Loading branch information
huantianad committed Jan 21, 2023
1 parent 909eed1 commit e6904d4
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/download.nim
Original file line number Diff line number Diff line change
Expand Up @@ -107,4 +107,10 @@ proc downloadLevel*(client: HttpClient, url: Uri, folder: string): string =
let filePath = ensureDirname(folder / getFilename(url, resp).removeExtension)
extractAll(tempFile, filePath)

# Ensure all extracted file have proper file permissions.
when defined(posix):
for kind, path in walkDir(filePath):
if kind == pcFile:
setFilePermissions(path, {fpUserWrite, fpUserRead, fpGroupRead, fpOthersRead})

filePath.extractFilename

0 comments on commit e6904d4

Please sign in to comment.