Skip to content

Fixes the deletion of the target directory after installation#1

Closed
anpieber wants to merge 1 commit into
linemanjs:masterfrom
anpieber:fix_deletion_of_target_dir_after_install
Closed

Fixes the deletion of the target directory after installation#1
anpieber wants to merge 1 commit into
linemanjs:masterfrom
anpieber:fix_deletion_of_target_dir_after_install

Conversation

@anpieber

Copy link
Copy Markdown

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

searls commented Dec 29, 2013

Copy link
Copy Markdown
Member

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
Copy Markdown
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