@@ -690,40 +690,22 @@ sub check_first_run {
690
690
# See if they're previously set SOME diff-highlight colors
691
691
my $has_dh_colors = git_config_boolean(' color.diff-highlight.oldnormal' ) || git_config_boolean(' color.diff-highlight.newnormal' );
692
692
693
+ # $first_run = 1; $has_dh_colors = 0;
694
+
693
695
if (!$first_run || $has_dh_colors ) {
694
696
return 0;
695
697
} else {
696
- my $interactive_shell = !has_stdin();
697
-
698
- # d-s-f run inside of LESS (can't prompt user)
699
- if (!$interactive_shell ) {
700
- my $warn = color(" yellow_on_red" );
701
- my $bold = color(" bold" );
702
- my $blink = color(" blink" );
703
- my $reset = color(" reset" );
704
-
705
- printf (" \n %s%s%sWarning :%s This appears to be the first time you've run diff-so-fancy. Please note that the\n " ,$blink ,$bold ,$warn ,$reset );
706
- printf (" default colors may not be optimal. Please run 'diff-so-fancy --colors' to see our color recommendations.\n " );
707
- printf (" To silence this error run: 'git config --global diff-so-fancy.first-run false'.\n\n " );
708
-
709
- return 0;
710
- }
698
+ print " This appears to be the first time you've run diff-so-fancy, please note\n " ;
699
+ print " that the default git colors are not ideal. Diff-so-fancy recommends the\n " ;
700
+ print " following colors.\n\n " ;
711
701
712
- print " This appears to be the first time you've run diff-so-fancy, would you like to\n " ;
713
- print " configure git to use diff-so-fancy for all diff operations and use the\n " ;
714
- print " recommended color scheme (y/N)?\n " ;
702
+ print get_default_colors();
715
703
716
- my $input = <STDIN >;
717
- $input = uc (trim($input ));
704
+ # Set the first run flag to false
705
+ my $cmd = ' git config --global diff-so-fancy.first-run false' ;
706
+ system ($cmd );
718
707
719
- # Set the default colors and git alias
720
- if ($input eq " Y" ) {
721
- set_defaults();
722
- # Just set the first-run flag to false so we don't pop this up again
723
- } else {
724
- my $cmd = ' git config --global diff-so-fancy.first-run false' ;
725
- system ($cmd );
726
- }
708
+ exit ;
727
709
}
728
710
729
711
return 1;
0 commit comments