Scriptable-Auto-Update
Scriptable-Auto-Update copied to clipboard
This simple wrapper for your Scriptable code automatically updates it locally every day.
Scriptable Auto Update
This simple wrapper for your Scriptable code automatically updates it locally every day.
Motivation
I'm a big fan of the Scriptable app. It's an excellent tool for creating custom widgets, for example. When sharing my code with other people, I didn't find an easy way to fix bugs or add features afterward. This wrapper aims to solve this challenge.
Features
- Automatically downloads your latest code every day from a URL
- If the update fails, it uses the latest locally available version
- Cleans up old locally saved versions automatically
- Executes your code every time it gets run
Usage
The wrapper will run the main() function of your code every time it gets executed. Therefore it's necessary to export the function at the end of your file like so:
module.exports = {
main
};
Copy the content from main.js and add your custom values to the scriptName
& scriptUrl
variables at the top of the file. Then simply paste it into Scriptable. The wrapper will automatically load and update your code from the URL.
Example
Take a look inside the example folder to see an implementation example.
Want to try it out? Then simply copy the content of example/main.js and paste it into Scriptable!
License
This repository is available under the MIT license.