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: offer ignore-platform-reqs option for composer. Add host alias #264

Merged
merged 1 commit into from
Aug 29, 2024
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
17 changes: 16 additions & 1 deletion packages/local-refresh/src/actions/ComposerInstall.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,26 @@ const phpAppDirectoryNames = ["api", "selfserve", "internal"];
const phpAppDirectories = phpAppDirectoryNames.map((dir) => path.resolve(__dirname, `../../../../app/${dir}`));

export default class ComposerInstall implements ActionInterface {
private ignorePlatformReqs: boolean = false;

async prompt(): Promise<boolean> {
const { shouldInstall } = await prompts({
type: "confirm",
name: "shouldInstall",
message: "Install Composer dependencies?",
});

if (shouldInstall) {
const { ignoreReqs } = await prompts({
type: "confirm",
name: "ignoreReqs",
message: "Do you want to add the --ignore-platform-reqs flag?",
initial: false,
});

this.ignorePlatformReqs = ignoreReqs;
}

return shouldInstall;
}

Expand All @@ -34,7 +47,9 @@ export default class ComposerInstall implements ActionInterface {
phpAppDirectories.forEach((dir) => {
debug(chalk.blue(`Running composer install in ${dir}...`));

exec("composer install --no-interaction --no-progress", debug, {
const command = `composer install ${this.ignorePlatformReqs ? '--ignore-platform-reqs' : ''} --no-interaction --no-progress`;

exec(command, debug, {
cwd: dir,
});

Expand Down
1 change: 1 addition & 0 deletions packages/local-refresh/src/actions/ResetDatabase.ts
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,7 @@ export default class ResetDatabase implements ActionInterface {
-e INSTALL_MYSQL=true \
-v "${this.etlDirectory}":/liquibase/changelog \
-w /liquibase/changelog \
--add-host=host.docker.internal:host-gateway \
liquibase/liquibase \
--defaultsFile=${this.liquibasePropertiesFileName} \
update \
Expand Down
Loading