Skip to content

Commit f565f71

Browse files
committed
1.0.7 - replace symbols even if they have no instances (they may be used in overrides)
1 parent 382faa9 commit f565f71

File tree

3 files changed

+8
-11
lines changed

3 files changed

+8
-11
lines changed

README.md

+1-2
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,7 @@ Replace symbols in the current document with symbols from a Library.
66
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.
77

88
## Installation
9-
10-
[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`
9+
[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`
1110

1211
## Usage
1312
### Preparing Libraries

library-symbol-replacer.sketchplugin/Contents/Sketch/manifest.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "Library Symbol Replacer",
33
"identifier": "com.zeroheight.library-symbol-replacer",
4-
"version": "1.0.6",
4+
"version": "1.0.7",
55
"description": "replace local symbols with library symbols",
66
"authorEmail": "[email protected]",
77
"author": "zeroheight team",

library-symbol-replacer.sketchplugin/Contents/Sketch/script.js

+6-8
Original file line numberDiff line numberDiff line change
@@ -37,14 +37,12 @@ var replaceSymbols = function(context) {
3737
var localSymbol = localLookup[symbolName];
3838
if(localSymbol){
3939
var instances = localSymbol.allInstances();
40-
if(instances.length > 0){
41-
totalInstances += instances.length;
42-
imports.push({
43-
localSymbol: localSymbol,
44-
librarySymbol: librarySymbol,
45-
localInstances: instances
46-
});
47-
}
40+
totalInstances += instances.length;
41+
imports.push({
42+
localSymbol: localSymbol,
43+
librarySymbol: librarySymbol,
44+
localInstances: instances
45+
});
4846
}
4947
}
5048

0 commit comments

Comments
 (0)