Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow pdk convert and pdk update to work in a ControlRepo context #1310

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion lib/pdk/cli/convert.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@ module CLI
# Write the context information to the debug log
PDK.context.to_debug_log

raise PDK::CLI::ExitWithError, '`pdk convert` can only be run from inside a valid module directory.' unless PDK.context.is_a?(PDK::Context::Module)
unless PDK.context.is_a?(PDK::Context::Module) || PDK.context.is_a?(PDK::Context::ControlRepo)
raise PDK::CLI::ExitWithError, '`pdk convert` can only be run from inside a valid module directory.'
end

raise PDK::CLI::ExitWithError, 'You can not specify --noop and --force when converting a module' if opts[:noop] && opts[:force]

Expand Down
4 changes: 3 additions & 1 deletion lib/pdk/cli/update.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@ module CLI
# Write the context information to the debug log
PDK.context.to_debug_log

raise PDK::CLI::ExitWithError, '`pdk update` can only be run from inside a valid module directory.' unless PDK.context.is_a?(PDK::Context::Module)
unless PDK.context.is_a?(PDK::Context::Module) || PDK.context.is_a?(PDK::Context::ControlRepo)
raise PDK::CLI::ExitWithError, '`pdk update` can only be run from inside a valid module directory.'
end

raise PDK::CLI::ExitWithError, 'This module does not appear to be PDK compatible. To make the module compatible with PDK, run `pdk convert`.' unless PDK::Util.module_pdk_compatible?

Expand Down