Skip to content

Commit 1313b45

Browse files
committed
!410 - added more keywrods now, dom, moy, wom, woy to build meta prefix.
1 parent a34b3d5 commit 1313b45

File tree

2 files changed

+40
-4
lines changed

2 files changed

+40
-4
lines changed

apps/Core/Packages/Devtools/Modules/DevtoolsModules.php

Lines changed: 39 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1696,9 +1696,21 @@ public function bumpVersion($data)
16961696
$module['buildMetaPrefix'] = explode('.', $module['buildMetaPrefix']);
16971697

16981698
array_walk($module['buildMetaPrefix'], function(&$prefix) {
1699-
if ($prefix === 'now') {
1699+
if ($prefix === 'now') {//now
17001700
$prefix = time();
17011701
}
1702+
if ($prefix === 'dom') {//day of month
1703+
$prefix = (\Carbon\Carbon::now())->day;
1704+
}
1705+
if ($prefix === 'moy') {//month of year
1706+
$prefix = (\Carbon\Carbon::now())->month;
1707+
}
1708+
if ($prefix === 'wom') {//week of month
1709+
$prefix = (\Carbon\Carbon::now())->weekOfMonth;
1710+
}
1711+
if ($prefix === 'woy') {//week of year
1712+
$prefix = (\Carbon\Carbon::now())->weekOfYear;
1713+
}
17021714
});
17031715
$parsedVersionString = $parsedVersionString . '+' . implode('.', $module['buildMetaPrefix']);
17041716
}
@@ -1788,9 +1800,21 @@ public function bumpVersion($data)
17881800
$module['buildMetaPrefix'] = explode('.', $module['buildMetaPrefix']);
17891801

17901802
array_walk($module['buildMetaPrefix'], function(&$prefix) {
1791-
if ($prefix === 'now') {
1803+
if ($prefix === 'now') {//now
17921804
$prefix = time();
17931805
}
1806+
if ($prefix === 'dom') {//day of month
1807+
$prefix = (\Carbon\Carbon::now())->day;
1808+
}
1809+
if ($prefix === 'moy') {//month of year
1810+
$prefix = (\Carbon\Carbon::now())->month;
1811+
}
1812+
if ($prefix === 'wom') {//week of month
1813+
$prefix = (\Carbon\Carbon::now())->weekOfMonth;
1814+
}
1815+
if ($prefix === 'woy') {//week of year
1816+
$prefix = (\Carbon\Carbon::now())->weekOfYear;
1817+
}
17941818
});
17951819

17961820
if (!isset($module['preReleasePrefix'])) {
@@ -1808,9 +1832,21 @@ public function bumpVersion($data)
18081832
$newVersion = explode('+', $newVersion)[0];
18091833

18101834
array_walk($module['buildMetaPrefix'], function(&$prefix) {
1811-
if ($prefix === 'now') {
1835+
if ($prefix === 'now') {//now
18121836
$prefix = time();
18131837
}
1838+
if ($prefix === 'dom') {//day of month
1839+
$prefix = (\Carbon\Carbon::now())->day;
1840+
}
1841+
if ($prefix === 'moy') {//month of year
1842+
$prefix = (\Carbon\Carbon::now())->month;
1843+
}
1844+
if ($prefix === 'wom') {//week of month
1845+
$prefix = (\Carbon\Carbon::now())->weekOfMonth;
1846+
}
1847+
if ($prefix === 'woy') {//week of year
1848+
$prefix = (\Carbon\Carbon::now())->weekOfYear;
1849+
}
18141850
});
18151851

18161852
if (!isset($module['preReleasePrefix'])) {

apps/Core/Views/Default/html/devtools/modules/module/release.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -293,7 +293,7 @@
293293
'fieldId' : 'build-meta-prefix',
294294
'fieldLabel' : 'Build Meta Prefix',
295295
'fieldHelp' : true,
296-
'fieldHelpTooltipContent' : 'Enter your build Meta Prefix. You can use keyword "now" for current unix time. Example: beta.now will produce beta.1714635771',
296+
'fieldHelpTooltipContent' : 'Enter your build Meta Prefix. You can use keyword "now" for current unix time. Example: beta.now will produce beta.1714635771. Keywords available are : now (current unix time), dom (day of month), moy (month of year), wom (week of month), woy (week of year)',
297297
'fieldType' : 'input',
298298
'fieldRequired' : true,
299299
'fieldDisabled' : buildMetaDisabled,

0 commit comments

Comments
 (0)