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

feat: add --no-interaction support to local refresh #266

Draft
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

jerotire
Copy link
Contributor

@jerotire jerotire commented Aug 21, 2024

Description

Adds support to local refresh for no interaction.

When using the flags -i or --no-interaction this runs the local refresh in non-interactive mode; this will execute the following: composer install, copy app dist files (all), reset database, create liquibase.properties file, flush redis, and reset ldap.

Before submitting (or marking as "ready for review")

  • Does the pull request title follow the conventional commit specification?
  • Have you performed a self-review of the code
  • Have you have added tests that prove the fix or feature is effective and working
  • Did you make sure to update any documentation relating to this change?

packages/local-refresh/src/index.ts Dismissed Show dismissed Hide dismissed
Copy link
Contributor

@JoshuaLicense JoshuaLicense left a comment

Choose a reason for hiding this comment

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

Looks good! Few things, one really minor.

Comment on lines 69 to 75
this.filesToCopy = files;
this.filesToCopy = Array.from(appConfigDistFiles.keys());
Copy link
Contributor

Choose a reason for hiding this comment

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

This would break the interactive version. Let's move the non-interactive version conditional to early exit after we have a list of files.

Something like this?

// ...
for (const dir of phpAppDirectories) {
  // ...
}

// ...
if (noInteraction) {
  this.filesToCopy = Array.from(appConfigDistFiles.keys());
}

// ...
const { files } = await prompts({
  // ...
});
// ...

packages/local-refresh/src/index.ts Outdated Show resolved Hide resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants