-
-
Save twhite96/d1683250b887379ea6fb17510983384b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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 getString = importModule('getString'); | |
const documentDirectory = FileManager.iCloud().documentsDirectory(); | |
const header = `// Variables used by Scriptable. | |
// These must be at the very top of the file. Do not edit. | |
// icon-color: deep-gray; icon-glyph: file-code;`; | |
module.exports = async ({moduleName, url}) => { | |
const moduleString = await getString({ url }); | |
FileManager.iCloud().writeString(`${documentDirectory}/${moduleName}.js`, `${header}\n${moduleString}`); | |
return importModule(moduleName); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment