App-GitHub-FixRepositoryName
view release on metacpan or search on metacpan
github-fix-repository-name My-Repository/ # ...should contain a .git directory
cd .git; github-fix-repository
# All of the above do the same thing, basically
DESCRIPTION
App::GitHub::FixRepositoryName will automatically find and update the
github repository URLs in .git/config (so that they have the right
casing). It will first make a backup of your .git/config AND it will
prompt you before writing out the new config (and show it to you first)
INSTALL
You can install App::GitHub::FixRepositoryName by using CPAN:
cpan -i App::GitHub::FixRepositoryName
If that doesn't work properly, you can find help at:
http://sial.org/howto/perl/life-with-cpan/
http://sial.org/howto/perl/life-with-cpan/macosx/ # Help on Mac OS X
inc/Module/Install/Makefile.pm view on Meta::CPAN
BEGIN {
$VERSION = '0.87';
$ISCORE = 1;
@ISA = qw{Module::Install::Base};
}
sub Makefile { $_[0] }
my %seen = ();
sub prompt {
shift;
# Infinite loop protection
my @c = caller();
if ( ++$seen{"$c[1]|$c[2]|$_[0]"} > 3 ) {
die "Caught an potential prompt infinite loop ($c[1]|$c[2]|$_[0])";
}
# In automated testing, always use defaults
if ( $ENV{AUTOMATED_TESTING} and ! $ENV{PERL_MM_USE_DEFAULT} ) {
local $ENV{PERL_MM_USE_DEFAULT} = 1;
goto &ExtUtils::MakeMaker::prompt;
} else {
goto &ExtUtils::MakeMaker::prompt;
}
}
sub makemaker_args {
my $self = shift;
my $args = ( $self->{makemaker_args} ||= {} );
%$args = ( %$args, @_ );
return $args;
}
lib/App/GitHub/FixRepositoryName.pm view on Meta::CPAN
github-fix-repository-name My-Repository/ # ...should contain a .git directory
cd .git; github-fix-repository
# All of the above do the same thing, basically
=head1 DESCRIPTION
App::GitHub::FixRepositoryName will automatically find and update the github repository URLs in .git/config (so that they have
the right casing). It will first make a backup of your .git/config AND it will prompt you before writing out
the new config (and show it to you first)
=head1 INSTALL
You can install L<App::GitHub::FixRepositoryName> by using L<CPAN>:
cpan -i App::GitHub::FixRepositoryName
If that doesn't work properly, you can find help at:
lib/App/GitHub/FixRepositoryName.pm view on Meta::CPAN
=head1 SEE ALSO
L<App::GitHub::FindRepository>
=cut
use File::AtomicWrite;
use App::GitHub::FindRepository;
use Path::Class;
use Carp::Clan;
use Term::Prompt qw/prompt/;
use Digest::SHA1 qw/sha1_hex/;
use File::Temp qw/tempfile/;
use Getopt::Long;
$Term::Prompt::MULTILINE_INDENT = '';
sub fix_file {
my $self = shift;
my $file = shift;
croak "Wasn't given file to fix" unless defined $file;
lib/App/GitHub/FixRepositoryName.pm view on Meta::CPAN
my ($content, $original_content) = $self->fix_file( $file );
if ($content eq $original_content) {
$print->( "Nothing to do to \"$file\"\n" );
return;
}
else {
$print->( $content );
$print->( "\n" ) unless $content =~ m/\n$/;
$print->( "---\n" );
unless ($given{always_yes}) {
my $Y = prompt( 'Y', "Do you want to write out the new .git/config to:\n\n$file\n\n? Y/n", 'Enter y or n', 'Y' );
unless ($Y) {
$print->( "Abandoning update to \"$file\"\n" );
return;
}
}
unless ( $given{no_backup} ) {
$backup_file = $self->_backup_file( $file, to => $given{backup_to}, template => $given{backup_template} );
$print->( "Made a backup of \"$file\" to \"$backup_file\"\n" );
}
File::AtomicWrite->write_file({ file => $file, input => \$content });
( run in 1.019 second using v1.01-cache-2.11-cpan-6aa56a78535 )