Skip to content

Commit c74d718

Browse files
committed
add option to ignore entire pages
1 parent 1348603 commit c74d718

File tree

6 files changed

+23
-14
lines changed

6 files changed

+23
-14
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## [0.7.0] - 2016-08-31
2+
3+
* add option to exclude entire pages from pretty diffs
4+
15

26
## [0.6.0] - 2016-08-27
37

Git.sketchplugin/Contents/Sketch/manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"author": "Mathieu Dutour",
55
"authorEmail" : "mathieu@dutour.me",
66
"homepage": "http://github.com/mathieudutour/git-sketch-plugin",
7-
"version": "0.6.0",
7+
"version": "0.7.0",
88
"identifier": "me.dutour.mathieu.git-plugin",
99
"compatibleVersion": 3,
1010
"bundleVersion": 2,

Git.sketchplugin/exportArtboard.sh

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -19,17 +19,7 @@ mv "$FILE_FOLDER" .oldArtboards 2>/dev/null
1919
IGNORE=$([ -e .sketchignore ] && (cat .sketchignore | sed '/^$/d' | sed 's/^/^/' | sed 's/$/$/' | tr '\n' ',') || echo "")
2020

2121
# get list of artboard names to export
22-
ARTBOARDS=$($BUNDLE_PATH/Contents/Resources/sketchtool/bin/sketchtool list artboards "$FILENAME" | grep -Eo '"name" :.*?[^\\]",' | cut -d '"' -f 4 | awk '{ N = split("'"$IGNORE"'", ignore, ",");
23-
if (N == 0) {
24-
print $0
25-
}
26-
for (i=1; i<=N; i++)
27-
if (ignore[i] && $0 ~ ignore[i]) {
28-
break
29-
} else if (i == N) {
30-
print $0
31-
}
32-
}' | tr '\n' ',')
22+
ARTBOARDS=$($BUNDLE_PATH/Contents/Resources/sketchtool/bin/sketchtool list artboards "$FILENAME" | python "$(dirname "$0")"/getArtboardNames.py "$IGNORE" | tr '\n' ',')
3323

3424

3525
# generate new artboards
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import json
2+
import sys
3+
import re
4+
5+
obj = json.load(sys.stdin)
6+
7+
ignore = map(re.compile, filter(None, sys.argv[1].split(",")))
8+
9+
for page in obj["pages"]:
10+
for artboard in page["artboards"]:
11+
name = page["name"] + "/" + artboard["name"]
12+
if len(ignore) == 0 or all(regex.match(name) == None for regex in ignore):
13+
print artboard["name"]

example/.sketchignore

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1-
ignored
1+
Page 1/ignored
22

3-
ignored-regex-(.*)
3+
Page 1/ignored-regex-(.*)
4+
5+
Ignored page/(.*)

example/example.sketch

8 KB
Binary file not shown.

0 commit comments

Comments
 (0)