Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
// Variables used by Scriptable.
// These must be at the very top of the file. Do not edit.
// icon-color: green; icon-glyph: file-code;
const getModule = importModule("getModule");
const documentDirectory = FileManager.iCloud().documentsDirectory();
module.exports = async ({ moduleName, url, forceDownload = false }) => {
if (moduleExists(moduleName) && !forceDownload) {
return importModule(moduleName);
}
return await getModule({ moduleName, url });
}
const moduleExists = (moduleName) => FileManager.iCloud().fileExists(`${documentDirectory}/${moduleName}.js`);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.