在symfony2中反向设计css和js文件

In symfony2 there are compiled and uncompiled css/js files i did not knew that. So we made changes to file directly under web/css and web/js folder. Now i am having trouble as to how to move the files to uncompiled files that is files under asset folders.

So i cannot run this command now: php app/console assetic:dump --env=prod --no-debug which will re-create all css and js files under web folder and we will loose all our changes.

Is there any command or way to reverse this? Like move our changes from web/css or web/js folder to assets with one go rather than hand picking them?

A way to do it would be to backup your web/css and web/js folders, then run php app/console assetic:dump --env=prod --no-debug again.

This way, you will have the version with changes (in the back-up) and without in web/css and web/js.

Then via a diff command on your server, you would be able to spot the changes you have to move manually back to the assets.

If you are on a production site and really need this operation to go quickly you can do this :
The first four commands are just to have a back up of the actual state. Then the rest is to recreate the assets as they should be and save those in a folder to compare them later on then reinstate the back up where your manual changes are so the people browsing your site won't hopefully have the time to notice anything.

cd web
cp -R js js.bk
cp -R css css.bk
cd .. 
php app/console assetic:dump --env=prod --no-debug && cd web && cp -R js js.clean && cp -R css css.clean && rm -R css && cp -R css.bk css && rm -R js && cp -R js.bk js

Then you can compare the folders .bk against le folders .clean

diff css.clean css.bk
diff js.clean js.bk

And readjust your changes on the right assets

A dummy example of a diff result :

bash$ diff a b
diff a/test.css b/test.css
1c1
< .a { color:#321; }
---
> .a { color:#123; }