MCPcopy
hub / github.com/witheve/Eve / loadFromGist

Method loadFromGist

src/ide.ts:2343–2363  ·  view source on GitHub ↗
(url:string)

Source from the content-addressed store, hash-verified

2341 }
2342
2343 loadFromGist(url:string) {
2344 if(!url) {
2345 this.injectNotice("warning", "Unable to open gist: No URL provided.");
2346 return;
2347 }
2348 readFromGist(url, (err, gist) => {
2349 if(err) {
2350 this.injectNotice("error", "Unable to read gist. Check the developer console for more information.");
2351 console.error(err);
2352 } else {
2353 //console.log(content);
2354 // @FIXME: Need the filename metadata here.
2355 // @FIXME: Should really be more flexible and provide all the files attached (can load a workspace from gist).
2356 for(let filename in gist.files) {
2357 let content = gist.files[filename].content;
2358 let docId = `gist:${gist.id}-${filename}`;
2359 this.loadFile(docId, content);
2360 }
2361 }
2362 });
2363 }
2364
2365 createDocument(folder:string) {
2366 let newId:string|undefined;

Callers 2

loadFileMethod · 0.95
NavigatorClass · 0.80

Calls 4

injectNoticeMethod · 0.95
loadFileMethod · 0.95
readFromGistFunction · 0.90
errorMethod · 0.80

Tested by

no test coverage detected