Skip to content

Commit 58c059a

Browse files
committed
(maint) Fix plan show for project plans
`bolt plan show <plan>` was failing when passed a project-level plan due to the fact that the project path is a Pathname rather than a string, unlike most modules. We now convert the path to a string in `get_plan_info` so that any code interacting with the plan data can treat it as if it came from any other module. !bug * **Fix `bolt plan show <plan>` for project-level plans** ([#1799](#1798)) This command was throwing errors due to a type mismatch that is now resolved.
1 parent e8c9952 commit 58c059a

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/bolt/pal.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -329,7 +329,8 @@ def get_plan_info(plan_name)
329329
raise Bolt::Error.unknown_plan(plan_name)
330330
end
331331

332-
mod = plan_sig.instance_variable_get(:@plan_func).loader.parent.path
332+
# path may be a Pathname object, so make sure to stringify it
333+
mod = plan_sig.instance_variable_get(:@plan_func).loader.parent.path.to_s
333334

334335
# If it's a Puppet language plan, use strings to extract data. The only
335336
# way to tell is to check which filename exists in the module.

0 commit comments

Comments
 (0)