Created
December 20, 2020 13:55
-
-
Save julio-kim/c311e5f28bc65f913b7f784978030e91 to your computer and use it in GitHub Desktop.
Scriptable Moduler
This file contains hidden or 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
let fm = FileManager.iCloud() | |
let dir = fm.documentsDirectory() | |
const baseDirs = [`${dir}/modules`, `${dir}/modules/moduler`] | |
baseDirs.forEach(dir => { | |
if (!fm.isDirectory(dir)) { | |
fm.createDirectory(dir) | |
} | |
}) | |
let request = new Request('https://scriptable-apps.github.io/modules/moduler/index.js') | |
let moduleFile = await request.loadString() | |
fm.writeString(`${baseDirs[1]}/index.js`, moduleFile) | |
await importModule('/modules/moduler').hello() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment