Skip to content
This repository has been archived by the owner on Sep 3, 2018. It is now read-only.

mathieudutour/sketch-module-update

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 

Repository files navigation

DO NOT USE THIS! Use the update mechanism provided by Sketch!


sketch-module-update

Downloads per month Latest version

A sketch module to check if an plugin's update is available on Github and prompt the user to download it.

Usage

update.js:

import update from 'sketch-module-update'

const repoFullName = 'mathieudutour/git-sketch-plugin'

const optionalOptions = {
  timeBetweenChecks: 24 * 60 * 60 * 1000, // 1 day by default
  title: 'A new MyPluginName plugin version is available!'
}

export default update(repoFullName, optionalOptions)

manifest.json:

...
"commands": [
  {
    "name": "update",
    "identifier": "update",
    "script": "update.cocoascript",
    "handlers" : {
      "actions": {
        "OpenDocument": "onRun"
      }
    }
  },
...

API Documentation

Options available:

name default
timeBetweenChecks 24 * 60 * 60 * 1000
prefKey repoFullName + '-update-last-check'
customizeAlert function (context, alert) {}
title 'A new ' + repo + ' plugin version is available!'
okButton Download update
laterButton Remind me later

Installation

sketch-module-update is available from npm.

npm install --save sketch-module-update

Compatibility

sketch-module-update requires Sketch >= 3.4 (not with the sandboxed version ie from the App Store).

About

A sketch module to check if an plugin's update is available

Resources

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Sponsor this project

 

Packages

No packages published