Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
Toolchain
sgc
Commits
d2d72807
Commit
d2d72807
authored
May 29, 2021
by
David Breitling
Browse files
[FEATURE] directly specify version bump
parent
08fc79e3
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
12 deletions
+23
-12
core/tasks/releaseExtension.js
core/tasks/releaseExtension.js
+23
-12
No files found.
core/tasks/releaseExtension.js
View file @
d2d72807
...
...
@@ -23,19 +23,28 @@ module.exports = class Open extends Task {
this
.
_logger
.
error
(
`Could not find extension in
${
yargs
.
ext
}
!`
);
resolve
();
}
else
{
const
answers
=
await
inquirer
.
prompt
([
{
type
:
'
confirm
'
,
name
:
'
major
'
,
message
:
'
Does the user need to apply changes to the code base or configuration after installing your update?
'
},
{
type
:
'
confirm
'
,
name
:
'
feature
'
,
message
:
'
Did you develop new features?
'
,
when
:
answers
=>
!
answers
.
major
if
(
yargs
.
major
||
yargs
.
minor
||
yargs
.
feature
||
yargs
.
patch
)
{
var
answers_tmp
=
{
major
:
!!
yargs
.
major
,
feature
:
!!
yargs
.
minor
||
!!
yargs
.
feature
,
patch
:
!!
yargs
.
patch
}
]);
}
else
{
var
answers_tmp
=
await
inquirer
.
prompt
([
{
type
:
'
confirm
'
,
name
:
'
major
'
,
message
:
'
Does the user need to apply changes to the code base or configuration after installing your update?
'
},
{
type
:
'
confirm
'
,
name
:
'
feature
'
,
message
:
'
Did you develop new features?
'
,
when
:
answers_v
=>
!
answers_v
.
major
}
]);
}
const
answers
=
answers_tmp
try
{
let
pathToComposer
=
`
${
process
.
cwd
()}
/
${
this
.
_config
.
directories
.
basePath
}
/
${
yargs
.
ext
}
/composer.json`
,
pathToExtEmconf
=
`
${
process
.
cwd
()}
/
${
this
.
_config
.
directories
.
basePath
}
/
${
yargs
.
ext
}
/ext_emconf.php`
,
...
...
@@ -61,6 +70,7 @@ module.exports = class Open extends Task {
_getNextVersionNumber
(
answers
,
currentVersion
)
{
let
numbers
=
currentVersion
.
split
(
'
.
'
);
if
(
answers
.
major
)
{
this
.
_logger
.
warning
(
"
You are releasing a new major version. Make sure you know what that entails.
"
)
numbers
[
0
]
=
parseInt
(
numbers
[
0
])
+
1
;
numbers
[
1
]
=
0
;
numbers
[
2
]
=
0
;
...
...
@@ -70,6 +80,7 @@ module.exports = class Open extends Task {
}
else
{
numbers
[
2
]
=
parseInt
(
numbers
[
2
])
+
1
;
}
this
.
_logger
.
info
(
`Bumping version number of
${
yargs
.
ext
}
:
${
currentVersion
}
=>
${
numbers
[
0
]}
.
${
numbers
[
1
]}
.
${
numbers
[
2
]}
`
)
return
`
${
numbers
[
0
]}
.
${
numbers
[
1
]}
.
${
numbers
[
2
]}
`
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment