0.1.4 • Published 9 years ago
sketch-module-update v0.1.4
sketch-module-update
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-updateCompatibility
sketch-module-update requires Sketch >= 3.4 (not with the sandboxed version ie from the App Store).