- function uploadAssetForRelease($repo, $release, callable $callback) {
- return $this->listHooks($repo->full_name, function($hooks) use($release, $repo, $callback) {
- $repo->hooks = $hooks;
- $hook = $this->checkRepoHook($repo);
- $phar = new Pharext\Package($repo->clone_url, $release->tag_name, $repo->name, $hook ? $hook->config : null);
- $name = sprintf("%s-%s.ext.phar", $repo->name, $release->tag_name);
+ function uploadAssetForRelease($repo, $release, $config = null) {
+ return $this->listHooks($repo->full_name)->then(function($result) use($release, $repo, $config) {
+ list($repo->hooks) = $result;
+ $phar = new Pharext\Package(
+ $repo->clone_url,
+ $release->tag_name,
+ $repo->name,
+ $config ?: (array) $this->checkRepoHook($repo)->config
+ );
+ $name = $phar->build();