894 | | if ( [ 'package.json', 'Gruntfile.js' ].some( testPath ) ) { |
895 | | grunt.log.writeln( 'Configuration files modified. Running `prerelease`.' ); |
896 | | taskList.push( 'prerelease' ); |
897 | | } else { |
898 | | if ( [ 'png', 'jpg', 'gif', 'jpeg' ].some( testExtension ) ) { |
899 | | grunt.log.writeln( 'Image files modified. Minifying.' ); |
900 | | taskList.push( 'precommit:image' ); |
901 | | } |
902 | | |
903 | | [ 'js', 'css', 'php' ].forEach( function( extension ) { |
904 | | if ( testExtension( extension ) ) { |
905 | | grunt.log.writeln( extension.toUpperCase() + ' files modified. ' + extension.toUpperCase() + ' tests will be run.' ); |
906 | | taskList.push( 'precommit:' + extension ); |
| 890 | if ( code === 0 ) { |
| 891 | if ( [ 'package.json', 'Gruntfile.js' ].some( testPath ) ) { |
| 892 | grunt.log.writeln( 'Configuration files modified. Running `prerelease`.' ); |
| 893 | taskList.push( 'prerelease' ); |
| 894 | } else { |
| 895 | if ( [ 'png', 'jpg', 'gif', 'jpeg' ].some( testExtension ) ) { |
| 896 | grunt.log.writeln( 'Image files modified. Minifying.' ); |
| 897 | taskList.push( 'precommit:image' ); |
908 | | } ); |
909 | | |
910 | | if ( [ 'twemoji.js' ].some( testPath ) ) { |
911 | | grunt.log.writeln( 'twemoji.js has updated. Running `precommit:emoji.' ); |
912 | | taskList.push( 'precommit:emoji' ); |
| 899 | |
| 900 | [ 'js', 'css', 'php' ].forEach( function( extension ) { |
| 901 | if ( testExtension( extension ) ) { |
| 902 | grunt.log.writeln( extension.toUpperCase() + ' files modified. ' + extension.toUpperCase() + ' tests will be run.' ); |
| 903 | taskList.push( 'precommit:' + extension ); |
| 904 | } |
| 905 | } ); |
| 906 | |
| 907 | if ( [ 'twemoji.js' ].some( testPath ) ) { |
| 908 | grunt.log.writeln( 'twemoji.js has updated. Running `precommit:emoji.' ); |
| 909 | taskList.push( 'precommit:emoji' ); |
| 910 | } |