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

base-href optional to support @angular/cli^10.0.0 #11

Merged
merged 3 commits into from
Jul 2, 2020
Merged

base-href optional to support @angular/cli^10.0.0 #11

merged 3 commits into from
Jul 2, 2020

Conversation

samuelnygaard
Copy link
Contributor

Since @angular/cli^10.0.0 have deprecated the base-href option for ng build and moved the configuration into the angular.json file, this actions gives this error Unknown option: '--base-href' when using a repo with Angular CLI version 10.

There i made the base-href semi-optional, so if you give an empty string or a null value as the input parameter, the parameter --base-href=/ will not be appended to the ng build instruction.

I have tested it and i works in my Actions.

Copy link
Contributor Author

@samuelnygaard samuelnygaard left a comment

Choose a reason for hiding this comment

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

@AhsanAyaz If needed i can revert the formatting chances, it is just my auto formatting.

@@ -44,17 +44,17 @@ You have to configure the `with` portion of your workflow file so that the actio

| Key | Value Information | Type | Required | Default |
| -------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------- | -------- | -------- |
| `angular_project_dir` | The directory of the angular project, in which all the commands will run. This is super handy when you have several projects within a workspace. Or have a demo angular project within a library. Defaults to current workspace directory | `with` | **Yes** | "" |
| `angular_project_dir` | The directory of the angular project, in which all the commands will run. This is super handy when you have several projects within a workspace. Or have a demo angular project within a library. Defaults to current workspace directory | `with` | **Yes** | "./" |
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This reflects the default values action.yml file

baseHref = '/';
let baseHrefString = '';
if (baseHref && baseHref.length > 0) {
baseHrefString = '--base-href=' + baseHref;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Im basically just moving the appending into this if statement instead of at the end

@AhsanAyaz
Copy link
Owner

Thanks for the PR @samuelnygaard 🙂
Highly appreciated! 🎉

@AhsanAyaz AhsanAyaz merged commit 55bd6e7 into AhsanAyaz:master Jul 2, 2020
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