From a192842dc06f03aedf5ab739c7e5be8ff9d2e22a Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Wed, 12 Jun 2013 18:22:43 -0700 Subject: [PATCH] Rename isExecutable() to isExecutableSync() --- spec/stdlib/command-installer-spec.coffee | 4 ++-- src/stdlib/fs-utils.coffee | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) 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