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

Fixes the deletion of the target directory after installation #1

Conversation

anpieber
Copy link

Looking into the documentation of the grunt-bower-task we read:

options.cleanTargetDir: Will clean target dir BEFORE running install.
options.cleanBowerDir: Will remove bower's dir AFTER copying all needed files into target dir.

Therefore, what we really want is cleanTargetDir instead of
cleanBowerDir

Looking into the documentation of the grunt-bower-task we read:

options.cleanTargetDir: Will clean target dir BEFORE running install.
options.cleanBowerDir: Will remove bower's dir AFTER copying all needed files into target dir.

Therefore, what we really want is cleanTargetDir instead of
cleanBowerDir
@searls
Copy link
Member

searls commented Dec 29, 2013

I believe I intentionally was deleting bower's directory and leaving the target one. Something something at this point source control gave up and all six of us working on this just said (╯°□°)╯︵ ┻━┻

@jasonkarns can you remember how this was supposed to be (as it pertains to this issue)?

@jasonkarns
Copy link
Member

I believe @searls is correct. Initially, in github-notifications, the bower directory was configured using the directory option in .bowerrc. This was changed in searls/github-notifications@1152a93 so that the bower directory was configured using the grunt-bower-task. However, the grunt-bower-task targetDir configuration option isn't a direct replacement for directory in .bowerrc. Most notably, components are still downloaded under bower_components, and grunt-bower-task simply copies them to targetDir. So, in order to get the behavior most similar to using directory in .bowerrc, the bower directory is deleted by grunt-bower-task (using options.cleanBowerDir). That is, components appear to be downloaded directly to vendor/bower. Of course, since bower itself is not actually aware of vendor/bower, then the components are re-downloaded each time grunt-bower-task triggers a bower install, which is obviously sub-optimal.

There is an open PR to grunt-bower-task to really make targetDir the real target location for bower components; as if it were set in .bowerrc. Until it is merged, options.cleanBowerDir will still be necessary.

If you're looking for a way to clean the target directory (vendor/bower), that is accomplished by lineman clean:bower (as configured here).

@jasonkarns jasonkarns closed this Dec 30, 2013
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.

3 participants