Skip to content

Warn when running Bolt as a gem #1779

@nicklewis

Description

@nicklewis

Use Case

When installed as a gem, Bolt doesn't include its bundled content. This causes unexpected behavior for users who should have installed the native package instead.

Also, it can cause problems for users who install bolt as gem and then later install the package, because the gem binary can shadow the package without the user realizing it.

Describe the Solution You Would Like

When invoking the bolt command from a gem install, it should issue some warning that this is probably not what you meant to do and should suggest installing the native package instead.

We should detect this by ensuring the bundled content directory is populated and issuing a warning if the CLI is invoked when it's empty.
We should check BOLT_GEM environment variable and if set to anything other than true disable this warning for users who want to embed bolt's entire CLI in another project.

Describe Alternatives You've Considered

• Including the bundled content with the gem. This would require some changes to the gem build process and detracts from our message that you shouldn't use the gem install.
• Not shipping the bolt command with the gem. This could break any testing use cases for the gem install that do require the command. It would also be unintuitive.

Metadata

Metadata

Assignees

Labels

FeatureNew features and improvements.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions