Skip to content

Instantly share code, notes, and snippets.

@torcado194
Last active January 24, 2020 23:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save torcado194/c1cff19ca14e0884994a638507b5c7cd to your computer and use it in GitHub Desktop.
Save torcado194/c1cff19ca14e0884994a638507b5c7cd to your computer and use it in GitHub Desktop.
fix for TorcAddons-watch-json-file
// ==UserScript==
// @name TorcAddons-watch-json-file
// @namespace http://torcado.com
// @description provides a watch.json button, to spawn a watch.json file, and set it's contents automatically to that to be compatible with torcAddons-ManualUpdate
// @author torcado and J-Tech-Foundation
// @license MIT
// @icon http://torcado.com/torcAddons/icon.png
// @run-at document-start
// @grant none
// @include http*://glitch.com/edit/*
// @version 0.0.1.20200121105715
// ==/UserScript==
(function () {
let t = torcAddons;
t.addEventListener('load', ()=>{
let code = `{
"install": {
"include": [
"^.torc-update"
]
},
"throttle": 10
}`;
let FI = application.fileByPath("watch.json");
if (FI === undefined) {
application.newFile("watch.json").then(f => {
application.writeToFile(f, code);
});
} else {
application.writeToFile(FI, code);
}
});
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment