Skip to content

Commit

Permalink
Add example for CLI building
Browse files Browse the repository at this point in the history
Closes #28
  • Loading branch information
tilgovi committed Mar 27, 2014
1 parent 88589b4 commit 6485547
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -126,3 +126,18 @@ optional keyword argument of the prefix in your configuration and it will return

``get_webassets_env(request or config)``: This will pull the environment out of the registry, you can use either
a configurator object or a request.

Building assets from a script
=======================================
The `webassets` module includes a command line script, also called `webassets`,
which can be used to build bundles offline. When integrating with Pyramid, it
can be helpful to bootstrap the environment using paster like so:

``` python
import pyramid.paster
import webassets.script

app_env = pyramid.paster.bootstrap('config.ini')
assets_env = app_env['request'].webasset_env
webassets.script.main(['build'], assets_env)
```

0 comments on commit 6485547

Please sign in to comment.