diff --git a/spec/stdlib/command-installer-spec.coffee b/spec/stdlib/command-installer-spec.coffee index ea7cf88b7..4bbeb928b 100644 --- a/spec/stdlib/command-installer-spec.coffee +++ b/spec/stdlib/command-installer-spec.coffee @@ -16,7 +16,7 @@ describe "install(commandPath, callback)", -> it "symlinks the command and makes it executable", -> fsUtils.write(commandPath, 'test') expect(fsUtils.isFileSync(commandPath)).toBeTruthy() - expect(fsUtils.isExecutable(commandPath)).toBeFalsy() + expect(fsUtils.isExecutableSync(commandPath)).toBeFalsy() expect(fsUtils.isFileSync(destinationPath)).toBeFalsy() installDone = false @@ -31,4 +31,4 @@ describe "install(commandPath, callback)", -> expect(installError).toBeNull() expect(fsUtils.isFileSync(destinationPath)).toBeTruthy() expect(fs.realpathSync(destinationPath)).toBe fs.realpathSync(commandPath) - expect(fsUtils.isExecutable(destinationPath)).toBeTruthy() + expect(fsUtils.isExecutableSync(destinationPath)).toBeTruthy() diff --git a/src/stdlib/fs-utils.coffee b/src/stdlib/fs-utils.coffee index af2c62fca..95eccf0a0 100644 --- a/src/stdlib/fs-utils.coffee +++ b/src/stdlib/fs-utils.coffee @@ -58,7 +58,7 @@ module.exports = false # Returns true if the specified path is exectuable. - isExecutable: (path) -> + isExecutableSync: (path) -> try (fs.statSync(path).mode & 0o777 & 1) isnt 0 catch e