Skip to content

Commit

Permalink
Merge branch 'release/v1.12'
Browse files Browse the repository at this point in the history
  • Loading branch information
borulday committed Mar 14, 2022
2 parents 965373e + dc5f0b3 commit 8a38213
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Zeplin.sketchplugin/Contents/Sketch/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"author": "Zeplin, Inc.",
"authorEmail": "dev@zeplin.io",
"homepage": "https://zeplin.io",
"version": "1.11",
"version": "1.12",
"identifier": "io.zeplin.sketch-plugin",
"icon": "Icons/icZeplin.png",
"commands": [{
Expand Down
16 changes: 16 additions & 0 deletions Zeplin.sketchplugin/Contents/Sketch/utils.cocoascript
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,16 @@ var writeDirectives = function (directives, path) {
return path;
}

var getShareId = function (context) {
try {
return context.document.cloudShare().shortID();
} catch (error) {
log("Getting cloud file “shortID” failed with error “" + error + "”."));
}

return nil;
}

var launchZeplin = function (context, path) {
var doc = context.document;
var workspace = [NSWorkspace sharedWorkspace];
Expand All @@ -189,6 +199,7 @@ var launchZeplin = function (context, path) {

var exportArtboards = function (context, artboards, temporaryPath) {
var doc = context.document;
var shareId = getShareId(context);

var foreignSymbolsUpToDate = true;
// `MSBadgeController` is defined on Sketch 44, `activeWindowBadgingActions` is defined on Sketch 46.
Expand Down Expand Up @@ -297,6 +308,11 @@ var exportArtboards = function (context, artboards, temporaryPath) {
[directives setObject:artboardNamesByIdentifier forKey:@"artboardNames"];
[directives setObject:containsArtboard forKey:@"containsArtboard"];

if (shareId) {
[directives setObject:shareId forKey:@"shareId"];
}

shareId = nil;
artboardIds = nil;
pageIds = nil;
uniqueArtboardSizes = nil;
Expand Down

0 comments on commit 8a38213

Please sign in to comment.