8000 skpm breaking my plugin · Issue #300 · skpm/skpm · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content 7FFF
skpm breaking my plugin #300
Open
Open
@eaugustine

Description

@eaugustine

I have a really small plugin that works fine, but when I use skpm to publish it, a bunch of extra code is added to the .sketchplugin file and causes it not to work. I'm using skpm so that it'll update in the Sketch Plugin library, but I don't need all the template stuff.

Sketch DevTools shows this when I run my plugin:

MOJavaScriptException: Error: Missing export named "inPage". Your command should contain something like `export function " + key +"() {}`.

I'm not sure why though, my plugin works fine when I run it directly from the plugin file before doing skpm build; this is all it is:

// Counts the number of artboards in the Sketch file
function inFile(context) {
	var sketch = require('sketch');
	var doc = context.document;
	const documentData = sketch.getSelectedDocument().sketchObject.documentData();
	var countFile = (documentData.allArtboards().count());
		doc.showMessage("This document has "+ countFile +" artboards");			
}

// Counts the number of artboards in the current page
function inPage(context) {
	var sketch = require('sketch');
	var doc = context.document;
	const currentPage = sketch.getSelectedDocument().selectedPage.sketchObject;
	var countPage = (currentPage.artboards().count());
		doc.showMessage("This page has "+ countPage +" artboards");
}

I'm not a developer and have been stumbling my way through all this; any help is appreciated 😅

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0