Skip to content

Commit

Permalink
add whitespace, remove extra newline on sound file, #872
Browse files Browse the repository at this point in the history
  • Loading branch information
pixelzoom committed Feb 25, 2020
1 parent 2c453d5 commit c485dac
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions js/grunt/modulify.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ const getSuffix = filename => {
};

const modulifyFile = async ( abspath, rootdir, subdir, filename ) => {

if ( subdir && ( subdir.startsWith( 'images' ) ||

// for brand
Expand All @@ -101,6 +102,7 @@ const modulifyFile = async ( abspath, rootdir, subdir, filename ) => {
&& IMAGE_SUFFIXES.indexOf( getSuffix( filename ) ) >= 0 ) {
modulifyImage( abspath );
}

if ( subdir && ( subdir.startsWith( 'mipmaps' ) ||

// for brand
Expand All @@ -110,13 +112,13 @@ const modulifyFile = async ( abspath, rootdir, subdir, filename ) => {
&& IMAGE_SUFFIXES.indexOf( getSuffix( filename ) ) >= 0 ) {
await modulifyMipmap( abspath );
}

if ( subdir && subdir.startsWith( 'sounds' ) ) {
if ( filename.endsWith( '.mp3' ) ) {
const x = loadFileAsDataURI( abspath );

const contents = `${HEADER}
export default {name:'${filename}',base64:'${x}'};
`;
export default {name:'${filename}',base64:'${x}'};`;

const outputFilename = replace( abspath, '.mp3', '_mp3.js' );
fs.writeFileSync( outputFilename, contents );
Expand All @@ -125,8 +127,7 @@ export default {name:'${filename}',base64:'${x}'};
const x = loadFileAsDataURI( abspath );

const contents = `${HEADER}
export default {name:'${filename}',base64:'${x}'};
`;
export default {name:'${filename}',base64:'${x}'};`;

const outputFilename = replace( abspath, '.wav', '_wav.js' );
fs.writeFileSync( outputFilename, contents );
Expand Down

0 comments on commit c485dac

Please sign in to comment.