Add executable permission in CopyFileOut
This commit is contained in:
parent
6ef6a83042
commit
cfdcfcbd80
4 changed files with 9 additions and 15 deletions
|
@ -13,6 +13,7 @@
|
|||
|
||||
#include "atom/common/asar/scoped_temporary_file.h"
|
||||
#include "base/files/file.h"
|
||||
#include "base/files/file_util.h"
|
||||
#include "base/logging.h"
|
||||
#include "base/pickle.h"
|
||||
#include "base/json/json_reader.h"
|
||||
|
@ -96,7 +97,6 @@ bool FillFileInfoWithNode(Archive::FileInfo* info,
|
|||
return false;
|
||||
info->size = static_cast<uint32>(size);
|
||||
|
||||
info->unpacked = false;
|
||||
if (node->GetBoolean("unpacked", &info->unpacked) && info->unpacked)
|
||||
return true;
|
||||
|
||||
|
@ -107,7 +107,6 @@ bool FillFileInfoWithNode(Archive::FileInfo* info,
|
|||
return false;
|
||||
info->offset += header_size;
|
||||
|
||||
info->executable = false;
|
||||
node->GetBoolean("executable", &info->executable);
|
||||
|
||||
return true;
|
||||
|
@ -276,6 +275,13 @@ bool Archive::CopyFileOut(const base::FilePath& path, base::FilePath* out) {
|
|||
if (!temp_file->InitFromFile(&file_, info.offset, info.size))
|
||||
return false;
|
||||
|
||||
#if defined(OS_POSIX)
|
||||
if (info.executable) {
|
||||
// chmod a+x temp_file;
|
||||
base::SetPosixFilePermissions(temp_file->path(), 0755);
|
||||
}
|
||||
#endif
|
||||
|
||||
*out = temp_file->path();
|
||||
external_files_.set(path, temp_file.Pass());
|
||||
return true;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue