OSDN Git Service
(root)
/
newslash
/
newslash.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
c333e33
)
Commnand: bypass "-f" flag checking when test mode
author
hylom
<hylom@users.sourceforge.jp>
Fri, 17 Aug 2018 11:00:14 +0000
(20:00 +0900)
committer
hylom
<hylom@users.sourceforge.jp>
Fri, 17 Aug 2018 11:00:14 +0000
(20:00 +0900)
src/newslash_web/lib/Newslash/Command.pm
patch
|
blob
|
history
diff --git
a/src/newslash_web/lib/Newslash/Command.pm
b/src/newslash_web/lib/Newslash/Command.pm
index
f5b1dff
..
8d85d1f
100644
(file)
--- a/
src/newslash_web/lib/Newslash/Command.pm
+++ b/
src/newslash_web/lib/Newslash/Command.pm
@@
-21,11
+21,14
@@
sub check_force_option {
}
if ($self->danger) {
- if (any { $_ !~ /^\s*-f\s*$/ } @$args) {
- $self->app->log->error("This command is dangerous, so needs '-f' option.");
- return;
+ my $mode = $self->app->mode;
+ if (!$mode || $mode ne "test") {
+ if (all { $_ !~ /^\s*-f\s*$/ } @$args) {
+ $self->app->log->error("This command is dangerous, so needs '-f' option under '$mode' mode.");
+ return;
+ }
+ @$args = grep { $_ !~ /^\s*-f\s*$/ } @$args;
}
- @$args = grep { $_ !~ /^\s*-f\s*$/ } @$args;
}
return 1;