Fixed fallback for rubocop executable

This commit is contained in:
Brian Bugh 2017-10-07 21:08:35 -05:00
parent bd93afa64c
commit 2d595f2a20
1 changed files with 1 additions and 2 deletions

View File

@ -23,7 +23,6 @@ module.exports = class Rubocop extends Beautifier
[projectPath, relativePath] = atom.project.relativizePath(fullPath) [projectPath, relativePath] = atom.project.relativizePath(fullPath)
# Find the rubocop path # Find the rubocop path
rubocopPath = "rubocop"
@Promise.all([ @Promise.all([
@which(options.rubocop_path) if options.rubocop_path @which(options.rubocop_path) if options.rubocop_path
@which('rubocop') @which('rubocop')
@ -31,7 +30,7 @@ module.exports = class Rubocop extends Beautifier
.then((paths) => .then((paths) =>
@debug('rubocop paths', paths) @debug('rubocop paths', paths)
# Get first valid, absolute path # Get first valid, absolute path
rubocopPath = paths.find((p) -> p and path.isAbsolute(p)) rubocopPath = paths.find((p) -> p and path.isAbsolute(p)) or "rubocop"
@verbose('rubocopPath', rubocopPath) @verbose('rubocopPath', rubocopPath)
@debug('rubocopPath', rubocopPath, paths) @debug('rubocopPath', rubocopPath, paths)
) )