From 5cfbd3cd9cc88c40552498144d686567e3b55300 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michae=CC=88l=20Fortin?= Date: Wed, 13 Mar 2019 16:51:38 -0400 Subject: [PATCH] Delete the contents of the save directory on export to avoid building up cruft (old assets, etc.) (cherry picked from commit 7a9c717ada51c9ff7c2e22b63ea138c326244558) --- Sketch Measure.sketchplugin/Contents/Sketch/library/common.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Sketch Measure.sketchplugin/Contents/Sketch/library/common.js b/Sketch Measure.sketchplugin/Contents/Sketch/library/common.js index 6c081fe..834d6a4 100755 --- a/Sketch Measure.sketchplugin/Contents/Sketch/library/common.js +++ b/Sketch Measure.sketchplugin/Contents/Sketch/library/common.js @@ -2885,6 +2885,9 @@ SM.extend({ savePath = this.getSavePath(); if(savePath){ + // Delete the files that are currently there to avoid building up cruft + NSFileManager.defaultManager().removeItemAtPath_error(savePath, nil); + // self.message(_("Exporting...")); var processingPanel = this.SMPanel({ url: this.pluginSketch + "/panel/processing.html",