File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed
PDF Export.sketchplugin/Contents/Sketch Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -299,14 +299,16 @@ function alertNoArtboards(message) {
299299
300300
301301// Return the version number for sketch — turned into a single integer
302- // e.g. '3.8.5' => 385, '40.2' => 402
302+ // e.g. '3.8.5' => 385, '40.2' => 402, '100' => 1000, '101.2' => 1012
303303function sketchVersionNumber ( ) {
304304 var version = NSBundle . mainBundle ( ) . objectForInfoDictionaryKey ( "CFBundleShortVersionString" )
305305 var versionNumber = version . stringByReplacingOccurrencesOfString_withString ( "." , "" ) + ""
306- while ( versionNumber . length != 3 ) {
307- versionNumber += "0"
306+ if ( versionNumber . length === version . length ( ) ) {
307+ // Account for version numbers without a decimal part (e.g. '99', '100', etc)
308+ return 10 * parseInt ( versionNumber )
309+ } else {
310+ return parseInt ( versionNumber )
308311 }
309- return parseInt ( versionNumber )
310312}
311313
312314// Return a JSON object from a file path
You can’t perform that action at this time.
0 commit comments