Skip to content

Commit

Permalink
1.0.7 - replace symbols even if they have no instances (they may be u…
Browse files Browse the repository at this point in the history
…sed in overrides)
  • Loading branch information
robintindale committed Oct 15, 2017
1 parent 382faa9 commit f565f71
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 11 deletions.
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@ Replace symbols in the current document with symbols from a Library.
Sketch 47 sees the introduction of Libraries, but migrating existing files to use Library symbols is one of the first big headaches. This plugin aims to help with that.

## Installation

[Download zip](https://github.com/zeroheight/library-symbol-replacer/releases/download/v1.0.6/library-symbol-replacer.sketchplugin.zip), unzip and double click the `.sketchplugin`
[Download zip](https://github.com/zeroheight/library-symbol-replacer/releases/download/v1.0.7/library-symbol-replacer.sketchplugin.zip), unzip and double click the `.sketchplugin`

## Usage
### Preparing Libraries
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "Library Symbol Replacer",
"identifier": "com.zeroheight.library-symbol-replacer",
"version": "1.0.6",
"version": "1.0.7",
"description": "replace local symbols with library symbols",
"authorEmail": "support@zeroheight.com",
"author": "zeroheight team",
Expand Down
14 changes: 6 additions & 8 deletions library-symbol-replacer.sketchplugin/Contents/Sketch/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,12 @@ var replaceSymbols = function(context) {
var localSymbol = localLookup[symbolName];
if(localSymbol){
var instances = localSymbol.allInstances();
if(instances.length > 0){
totalInstances += instances.length;
imports.push({
localSymbol: localSymbol,
librarySymbol: librarySymbol,
localInstances: instances
});
}
totalInstances += instances.length;
imports.push({
localSymbol: localSymbol,
librarySymbol: librarySymbol,
localInstances: instances
});
}
}

Expand Down

0 comments on commit f565f71

Please sign in to comment.