Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

allow using .bashrc instead of .bashrc.load

Fixes #9
  • Loading branch information...
commit f96a5a7c1b06a2fb8cabeff747b9125238a7267a 1 parent 9a955ca
@justone authored
Showing with 23 additions and 1 deletion.
  1. +3 −1 bin/dfm
  2. +4 −0 t/01.simple.t
  3. +16 −0 t/03.uninstall.t
View
4 bin/dfm
@@ -65,7 +65,9 @@ if ( $command eq 'install' ) {
install_files( $home . '/' . $repo_dir, $home );
# link in the bash loader
- configure_bash_loader();
+ if ( -e "$home/$repo_dir/.bashrc.load" ) {
+ configure_bash_loader();
+ }
}
elsif ( $command eq 'updates' ) {
GetOptions( \%opts, 'no-fetch' );
View
4 t/01.simple.t
@@ -19,6 +19,8 @@ subtest 'simplest' => sub {
my ( $home, $repo, $origin );
( $home, $repo, $origin ) = minimum_home('simple');
( $home, $repo ) = minimum_home( 'simple2', { origin => $origin } );
+ `touch $repo/.bashrc.load`; # make sure there's a loader
+
my $output = `HOME=$home perl $repo/bin/dfm --verbose`;
ok( -d "$home/.backup", 'main backup dir exists' );
@@ -57,6 +59,7 @@ subtest 'with . ssh recurse( no . ssh dir )' => sub {
focus('recurse_no');
my ( $home, $repo ) = minimum_home_with_ssh( 'ssh_no', 1 );
+ `touch $repo/.bashrc.load`; # make sure there's a loader
my $output = `HOME=$home perl $repo/bin/dfm --verbose`;
check_ssh_recurse($home);
@@ -66,6 +69,7 @@ subtest 'with .ssh recurse (with .ssh dir)' => sub {
focus('recurse_with');
my ( $home, $repo ) = minimum_home_with_ssh('ssh_with');
+ `touch $repo/.bashrc.load`; # make sure there's a loader
my $output = `HOME=$home perl $repo/bin/dfm --verbose`;
check_ssh_recurse($home);
View
16 t/03.uninstall.t
@@ -17,6 +17,7 @@ subtest 'uninstall dotfiles' => sub {
focus('uninstall');
my ( $home, $repo ) = minimum_home_with_ssh('uninstall');
+ `touch $repo/.bashrc.load`; # make sure there's a loader
extra_setup($home);
my $output;
@@ -26,6 +27,13 @@ subtest 'uninstall dotfiles' => sub {
ok( -d "$home/.backup", 'main backup dir exists' );
ok( -l "$home/bin", 'bin is a symlink' );
+SKIP: {
+ skip 'File::Slurp not found', 1 unless $file_slurp_available;
+
+ ok( read_file("$home/$profile_filename") =~ /bashrc.load/,
+ "loader present in $profile_filename" );
+ }
+
$output = `HOME=$home perl $repo/bin/dfm --verbose uninstall`;
ok( !-l "$home/bin", 'bin is no longer a symlink' );
@@ -49,6 +57,7 @@ subtest 'uninstall dotfiles (dry-run)' => sub {
focus('uninstall_dry');
my ( $home, $repo ) = minimum_home_with_ssh('uninstall');
+ `touch $repo/.bashrc.load`; # make sure there's a loader
extra_setup($home);
my $output;
@@ -58,6 +67,13 @@ subtest 'uninstall dotfiles (dry-run)' => sub {
ok( -d "$home/.backup", 'main backup dir exists' );
ok( -l "$home/bin", 'bin is a symlink' );
+SKIP: {
+ skip 'File::Slurp not found', 1 unless $file_slurp_available;
+
+ ok( read_file("$home/$profile_filename") =~ /bashrc.load/,
+ "loader present in $profile_filename" );
+ }
+
$output = `HOME=$home perl $repo/bin/dfm --dry-run --verbose uninstall`;
ok( -l "$home/bin", 'bin is still a symlink' );
Please sign in to comment.
Something went wrong with that request. Please try again.