Skip to content

Commit

Permalink
fix: Honor both Gemfile as well as gems.rb in rails detection
Browse files Browse the repository at this point in the history
  • Loading branch information
tommasongr committed Feb 10, 2022
1 parent c8a1f4c commit 6af16f2
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/Scripts/helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,13 @@ export function showNotification(
}

export function isRailsInProject() {
const gemfilePath = nova.workspace.path + '/Gemfile'
let gemfilePath

if (!nova.fs.access(gemfilePath, nova.fs.F_OK)) {
if (nova.fs.access(nova.workspace.path + '/Gemfile', nova.fs.F_OK)) {
gemfilePath = nova.workspace.path + '/Gemfile'
} else if (nova.fs.access(nova.workspace.path + '/gems.rb', nova.fs.F_OK)) {
gemfilePath = nova.workspace.path + '/gems.rb'
} else {
return false
}

Expand Down

0 comments on commit 6af16f2

Please sign in to comment.