bin/yukki-passwd

filter: Statementstmt 94.7% 18 / 19 Branchbran 50.0% 1 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 4 / 4 Podpod n/a totaltotal 92.0% 23 / 25 CC 1 SCAR 0.0
CC
1
Cov
90%
BEGIN
1.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.0
« blib/lib/Yukki/Settings.pm ↑ Summary bin/yukki-git-init »
1 #!/usr/bin/env perl
2 1 ▶use v5.24;
Subroutine BEGIN: called CC=1 SCAR=0.0
3 1 ▶use utf8;
Subroutine BEGIN: called CC=1 SCAR=0.0
4  
5 1 ▶use Yukki;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 1 ▶use Yukki::TextUtil qw( prompt dump_file load_file );
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 1 my $app = Yukki->new;
9  
10 1 my $username = prompt 'Login name:';
11  
12 1 my $user = $app->model('User')->find(login_name => $username);
13 1 ▶if (not defined $user) {
Branch: 1 branch
BranchTrueFalseTotal
unless (defined $user) 0 1 1
14 0 die "User $username does not exist. Please create this user before setting the password.\n";
15 }
16  
17 1 my $password = prompt 'Password:', -echo => '', -v;
18  
19 1 $app->model('User')->set_password($user, $password);
20 1 $app->model('User')->save($user);
21  
22 # ABSTRACT: set the password for a user
23 # PODNAME: yukki-passwd
24  
25 __END__
« blib/lib/Yukki/Settings.pm ↑ Summary bin/yukki-git-init »