Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[FrameworkBundle] Do not remove files from assets dir #23378

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

Merged
merged 1 commit into from
Jul 4, 2017

Conversation

1ed
Copy link
Contributor

@1ed 1ed commented Jul 4, 2017

Q A
Branch? 2.7
Bug fix? yes
New feature? no
BC breaks? no
Deprecations? no
Tests pass? yes
Fixed tickets -
License MIT
Doc PR -

The patch introduced in #23195 removes files from web/bundles (eg. .gitignore) which is unintentional I think.

}
}
$dirsToRemove = Finder::create()->depth(0)->directories()->exclude($validAssetDirs)->in($bundlesDir);
$filesystem->remove($dirsToRemove);
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 should be $this->filesystem when merging into >= 2.8.

@fabpot
Copy link
Member

fabpot commented Jul 4, 2017

Thank you @1ed.

@fabpot fabpot merged commit 6ed9c8d into symfony:2.7 Jul 4, 2017
fabpot added a commit that referenced this pull request Jul 4, 2017
This PR was merged into the 2.7 branch.

Discussion
----------

[FrameworkBundle] Do not remove files from assets dir

| Q             | A
| ------------- | ---
| Branch?       | 2.7
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | -
| License       | MIT
| Doc PR        | -

The patch introduced in #23195 removes files from `web/bundles` (eg. `.gitignore`) which is unintentional I think.

Commits
-------

6ed9c8d [FrameworkBundle] Do not remove files from assets dir
@fabpot fabpot mentioned this pull request Jul 5, 2017
@fabpot fabpot mentioned this pull request Jul 5, 2017
@fabpot fabpot mentioned this pull request Jul 5, 2017
@fabpot fabpot mentioned this pull request Jul 5, 2017
@stof
Copy link
Member

stof commented Jul 5, 2017

Will this still delete outdated symlinks when the target directory is removed ?

@1ed
Copy link
Contributor Author

1ed commented Jul 5, 2017

Yes, it removes broken symlinks as well.

$ ln -s ../broken-symlink web/bundles/broken-symlink

$ ls -al web/bundles/
total 12
drwxr-xr-x 2 egabor egabor 4096 júl    5 16:42 .
drwxr-xr-x 3 egabor egabor 4096 júl    5 15:41 ..
lrwxrwxrwx 1 egabor egabor   17 júl    5 16:42 broken-symlink -> ../broken-symlink

$ bin/console assets:install --relative

 Trying to install assets as relative symbolic links.

 -- -------- ---------------- 
     Bundle   Method / Error  
 -- -------- ---------------- 

                                                                                                                        
 [OK] All assets were successfully installed.                                                                           
                                                                                                                        

$ ls -al web/bundles/
total 8
drwxr-xr-x 2 egabor egabor 4096 júl    5 16:43 .
drwxr-xr-x 3 egabor egabor 4096 júl    5 15:41 ..

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants