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

fix(builders): #125 add bower component dir resolution #127

Merged
merged 1 commit into from
Apr 18, 2018

Conversation

xizhao
Copy link
Contributor

@xizhao xizhao commented Apr 18, 2018

Closes #125 by parsing .bowerrc

@xizhao xizhao requested a review from elldritch April 18, 2018 22:27
Copy link
Member

@elldritch elldritch left a comment

Choose a reason for hiding this comment

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

LGTM, with minor improvements.

bowerConfigPath := filepath.Join(dir, ".bowerrc")
bowerComponentsPath := filepath.Join(dir, "bower_components")

if bowerConfigExists, _ := hasFile(bowerConfigPath); bowerConfigExists {
Copy link
Member

Choose a reason for hiding this comment

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

I'd prefer if this error weren't suppressed.

// IsBuilt checks for the existence of `$PROJECT/bower_components`
func (builder *BowerBuilder) IsBuilt(m module.Module, allowUnresolved bool) (bool, error) {
bowerLogger.Debug("Checking Bower build: %#v %#v", m, allowUnresolved)

// TODO: Check if the installed modules are consistent with what's in the
// actual manifest.
isBuilt, err := hasFile(m.Dir, "bower_components")
isBuilt, err := hasFile(resolveBowerComponentsDirectory(m.Dir))
if err != nil {
return false, fmt.Errorf("could not find Bower dependencies folder: %s", err.Error())
Copy link
Member

Choose a reason for hiding this comment

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

TBH, this just shouldn't cause an error. Can you change this to log a warning instead?

@xizhao xizhao merged commit 64ddd93 into master Apr 18, 2018
@elldritch elldritch deleted the fix/support-bower-custom-folder branch June 1, 2018 05:02
meghfossa pushed a commit that referenced this pull request Nov 12, 2021
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.

None yet

2 participants