Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UploadToCPAN.pm: shell option at prompt, use env var for password #309

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 6 additions & 1 deletion lib/Minilla/Release/UploadToCPAN.pm
Expand Up @@ -29,6 +29,7 @@ sub run {
: ($project->config->{release}->{pause_config}) ? $project->config->{release}->{pause_config}
: undef;
my $config = CPAN::Uploader->read_config_file($pause_config);
$config->{password} //= $ENV{CPAN_UPLOADER_UPLOAD_PASSWORD} // undef;
if (!$config || !$config->{user} || !$config->{password}) {
die <<EOF

Expand All @@ -43,11 +44,15 @@ EOF
}

PROMPT: while (1) {
my $answer = prompt("Release to " . ($config->{upload_uri} || 'CPAN') . ' ? [y/n] ');
my $answer = prompt("Release to " . ($config->{upload_uri} || 'CPAN') . ' ? [y/n/s[hell]] ');
if ($answer =~ /y/i) {
last PROMPT;
} elsif ($answer =~ /n/i) {
errorf("Giving up!\n");
} elsif ($answer =~ /^s/i) {
print "tar file: $tar\n";
system ($ENV{ SHELL } or 'sh');
redo PROMPT;
} else {
redo PROMPT;
}
Expand Down