Skip to content

Commit

Permalink
Use a slightly less brittle workaround
Browse files Browse the repository at this point in the history
Fixes #84
  • Loading branch information
bomberstudios committed Sep 21, 2021
1 parent 51a865c commit 6e81ab5
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/plugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,11 @@ export function compress(context) {
if (currentExport.request.format() == 'svg') {
filesToCompress++
let currentFile
if (sketch.version.sketch == '76' || sketch.version.sketch == '76.1') {
// This was broken momentarily in Sketch 76 and 76.1,
// so we need to use a workaround
// This was broken momentarily between Sketch 76 and 77
// so we need to use a workaround
currentFile = currentExport.path
if (currentExport.path.path !== undefined) {
currentFile = currentExport.path.path()
} else {
currentFile = currentExport.path
}
const svgString = fs.readFileSync(currentFile, 'utf8')
const config = {...loadConfig(), ...{
Expand Down

0 comments on commit 6e81ab5

Please # to comment.