|
|
|
@ -107,13 +107,28 @@ sub init { |
|
|
|
|
|
|
|
|
|
|
|
# Clone the template repo |
|
|
|
# Clone the template repo |
|
|
|
$self->system_command( [ qw( git clone ), $self->init_from, $self->repo_path ] ); |
|
|
|
$self->system_command( [ qw( git clone ), $self->init_from, $self->repo_path ] ); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# Kill the git repo |
|
|
|
|
|
|
|
$self->system_command( [ qw( rm -fr .git ) ], { |
|
|
|
|
|
|
|
chdir => $self->repo_path, |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
# Update the origin that is set |
|
|
|
# Create new git repo |
|
|
|
$self->system_command( [ qw( git remote set-url origin ), $self->repo ], { |
|
|
|
$self->system_command( [ qw( git init ) ], { |
|
|
|
|
|
|
|
chdir => $self->repo_path, |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# Add all the files. |
|
|
|
|
|
|
|
$self->system_command( [ qw( git add .gitignore * ) ], { |
|
|
|
|
|
|
|
chdir => $self->repo_path, |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# Add the origin |
|
|
|
|
|
|
|
$self->system_command( [ qw( git remote add origin ), $self->repo ], { |
|
|
|
chdir => $self->repo_path, |
|
|
|
chdir => $self->repo_path, |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
# Confirm the origin updated |
|
|
|
# Confirm the origin |
|
|
|
my $return = $self->system_command( [ qw( git remote get-url origin ) ], { |
|
|
|
my $return = $self->system_command( [ qw( git remote get-url origin ) ], { |
|
|
|
chdir => $self->repo_path, |
|
|
|
chdir => $self->repo_path, |
|
|
|
}); |
|
|
|
}); |
|
|
|
|