Skip to content

Commit 4045134

Browse files
authored
Merge pull request #276 from wordpress-mobile/fix/broken-plugin_root-for-promo-screenshots
Fix a bug in the `plugin_root` method
2 parents f2980a3 + d8da041 commit 4045134

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ _None_
1414

1515
### Bug Fixes
1616

17-
_None_
17+
Fixes a bug that was breaking the `promo_screenshots` helper [#276]
1818

1919
### Internal Changes
2020

lib/fastlane/plugin/wpmreleasetoolkit/helper/filesystem_helper.rb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,9 @@ def self.plugin_root
3636
while continue
3737
child_filenames = dir.children.map! { |x| File.basename(x) }
3838

39-
if child_filenames.include? 'fastlane-plugin-wpmreleasetoolkit.gemspec'
39+
# The first case is for development – where the `.gemspec` is present in the project root
40+
# The second case is for production – where there's no `.gemspec`, but the root dir of the plugin is named `fastlane-plugin-wpmreleasetoolkit-{version}`.
41+
if child_filenames.include?('fastlane-plugin-wpmreleasetoolkit.gemspec') || File.basename(dir).start_with?('fastlane-plugin-wpmreleasetoolkit-')
4042
continue = false
4143
else
4244
dir = dir.parent

0 commit comments

Comments
 (0)