Skip to content

Commit

Permalink
Fix file executable check on win32 (marktext#3289)
Browse files Browse the repository at this point in the history
  • Loading branch information
Xander-C committed Jun 8, 2022
1 parent 2bb405a commit a2eb04a
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/renderer/util/fileSystem.js
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,11 @@ export const uploadImage = async (pathname, image, preferences) => {
export const isFileExecutableSync = (filepath) => {
try {
const stat = statSync(filepath)
return stat.isFile() && (stat.mode & (constants.S_IXUSR | constants.S_IXGRP | constants.S_IXOTH)) !== 0
if (process.platform === 'win32') {
return stat.isFile()
} else {
return stat.isFile() && (stat.mode & (constants.S_IXUSR | constants.S_IXGRP | constants.S_IXOTH)) !== 0
}
} catch (err) {
// err ignored
return false
Expand Down

0 comments on commit a2eb04a

Please sign in to comment.