+ //Retrieve asset uri
+ //XXX: this path is the merge of services.assets.path_package.arguments[0] and rapsys_pack.output.(css,img,js)
+ if (($outputUrl = $this->package->getUrl($output)) === false) {
+ throw new RuntimeError(sprintf('Unable to get url for asset: %s', $output), $token->getLine(), $stream->getSourceContext());
+ }
+
+ //Check if we have a bundle path
+ if ($output[0] == '@') {
+ //Check that we have a / separator between bundle name and path
+ if (($pos = strpos($output, '/')) === false) {
+ throw new RuntimeError(sprintf('Invalid output path "%s"', $output), $token->getLine(), $stream->getSourceContext());
+ }
+ //Resolve bundle prefix
+ $output = $this->locator->locate(substr($output, 0, $pos)).substr($output, $pos + 1);
+ }
+
+ //Create output dir if not present
+ if (!is_dir($dir = dirname($output))) {