Skip to content
This repository was archived by the owner on Jun 11, 2024. It is now read-only.

Commit 9b48d50

Browse files
Use regex for carriage return in windows
In windows env, the ImageMagick version string is containing \r\n at the end of each line, split and replace methods are keeping this \r leading to an issue with semver.valid() returning false because extracted imVersion is something like '6.9.3-2\r'
1 parent 71ccc63 commit 9b48d50

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/themeroller-image.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -346,7 +346,7 @@ async.series([
346346
if ( !(/ImageMagick/).test( output ) ) {
347347
return callback( new Error( "ImageMagick not installed.\n" + output ) );
348348
}
349-
imVersion = output.split( "\n" )[ 0 ].replace( /^Version: ImageMagick ([^ ]*).*/, "$1" );
349+
imVersion = output.split( /\r?\n/ )[ 0 ].replace( /^Version: ImageMagick ([^ ]*).*/, "$1" );
350350
if ( !semver.valid( imVersion ) ) {
351351
return callback( new Error( "Could not identify ImageMagick version.\n" + output ) );
352352
}

0 commit comments

Comments
 (0)