Last active
September 29, 2017 20:05
-
-
Save scripting/f122c9356733ac7373e60ae865fef702 to your computer and use it in GitHub Desktop.
Example of the kind of code I routinely write for system scripting
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
local (sourcefolder = user.prefs.dropboxfolder + "public:misc:nodeeditor:fargo.io-code-publisher:"); | |
local (githubfolder = user.prefs.githubfolder + "fargoPublisher:"); | |
local (montaukfolder = user.prefs.dropboxfolder + "montauk:fargopub:"); | |
on copyone (f1, f2) { | |
file.surefilepath (f2); | |
try { | |
if file.readwholefile (f1) != file.readwholefile (f2) { | |
file.copy (f1, f2) | |
} | |
} | |
else { | |
file.copy (f1, f2) | |
} | |
}; | |
fileloop (f in sourcefolder) { //copy to montauk | |
local (fname = file.filefrompath (f)); | |
if not (fname endswith ".opml") { | |
copyone (f, montaukfolder + fname) | |
} | |
}; | |
copyone (sourcefolder + "publisher.js", githubfolder + "publisher.js"); | |
copyone (sourcefolder + "package.json", githubfolder + "package.json"); | |
copyone (sourcefolder + "readme.md", githubfolder + "README.md"); | |
speaker.beep () |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This is used as an example in this piece --
scripting/Scripting-News#31