Skip to content

Commit 7a0868f

Browse files
committed
DX: update branch alias
1 parent bd5a1c5 commit 7a0868f

File tree

2 files changed

+29
-1
lines changed

2 files changed

+29
-1
lines changed

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@
5555
},
5656
"extra": {
5757
"branch-alias": {
58-
"dev-master": "2.15-dev"
58+
"dev-master": "2.16-dev"
5959
}
6060
},
6161
"autoload": {
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
#!/usr/bin/env php
2+
<?php
3+
4+
require_once __DIR__.'/../vendor/autoload.php';
5+
6+
const COMPOSER_JSON_FILE = __DIR__.'/../composer.json';
7+
8+
/**
9+
* @param string $version
10+
*
11+
* @return string
12+
*/
13+
function convertAppVersionToAliasedVersion($version)
14+
{
15+
$parts = explode('.', $version, 3);
16+
17+
return sprintf('%d.%d-dev', $parts[0], $parts[1]);
18+
}
19+
20+
$composerJson = json_decode(file_get_contents(COMPOSER_JSON_FILE), true);
21+
22+
if (isset($composerJson['extra']['branch-alias'])) {
23+
$composerJson['extra']['branch-alias'] = [
24+
'dev-master' => convertAppVersionToAliasedVersion(PhpCsFixer\Console\Application::VERSION),
25+
];
26+
}
27+
28+
file_put_contents(COMPOSER_JSON_FILE, json_encode($composerJson, JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE | JSON_PRETTY_PRINT)."\n");

0 commit comments

Comments
 (0)