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

Use --config and --postrequire when calling the init command #957

Merged
merged 3 commits into from
Jun 1, 2022

Conversation

Morriar
Copy link
Collaborator

@Morriar Morriar commented May 31, 2022

Motivation

I noticed that we were defining the option --config at the top level and loaded the configuration from the path provided by this option yet, we always created the config at a fixed location when calling tapioca init.

Same for the require.rb file. It was loaded from the path provided through the --postrequire option yet the file was always created at a fixed path when calling tapioca init.

Tests

See automated tests.

Signed-off-by: Alexandre Terrasa <alexandre.terrasa@shopify.com>
Signed-off-by: Alexandre Terrasa <alexandre.terrasa@shopify.com>
Signed-off-by: Alexandre Terrasa <alexandre.terrasa@shopify.com>
@Morriar Morriar added the enhancement New feature or request label May 31, 2022
@Morriar Morriar requested a review from a team May 31, 2022 23:27
@Morriar Morriar self-assigned this May 31, 2022
def init
command = Commands::Init.new(
sorbet_config: SORBET_CONFIG_FILE,
tapioca_config: TAPIOCA_CONFIG_FILE,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For my own understanding: where did this TAPIOCA_CONFIG_FILE originally come from?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Most of the path constants are defined here: https://github.com/Shopify/tapioca/blob/main/lib/tapioca.rb#L29

The same constant is used as default value for the option here: https://github.com/Shopify/tapioca/blob/main/lib/tapioca/cli.rb#L18

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh I see. Thank you!

@Morriar Morriar merged commit bcdd971 into main Jun 1, 2022
@Morriar Morriar deleted the at-config branch June 1, 2022 15:46
@shopify-shipit shopify-shipit bot temporarily deployed to production July 7, 2022 17:53 Inactive
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants