From a5c5a6f7f829b33f7c3818a25cbcb65ecd68cbdc Mon Sep 17 00:00:00 2001 From: Jeremy Magland Date: Thu, 27 Jun 2024 12:25:30 -0400 Subject: [PATCH] Add comments to loadFilesFromGist --- gui/src/app/SPAnalysis/loadFilesFromGist.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/gui/src/app/SPAnalysis/loadFilesFromGist.ts b/gui/src/app/SPAnalysis/loadFilesFromGist.ts index 4762b0af..e2b2998f 100644 --- a/gui/src/app/SPAnalysis/loadFilesFromGist.ts +++ b/gui/src/app/SPAnalysis/loadFilesFromGist.ts @@ -19,13 +19,19 @@ const loadFilesFromGist = async (gistUri: string): Promise<{ files: { [key: stri if (!file) continue let content = file.content if (content === undefined) continue - // gists do not support empty files or whitespace-only files + // Gists do not support empty files or whitespace-only files. This + // provides a workaround for that by allowing the user to specify an + // empty file by starting the content with the string '<>'. This + // is then removed from the content. if (content.startsWith('<>')) { const x = content.slice('<>'.length) if (x.trim() === '') { content = x } } + // Gists do not support directories This is a placeholder for the future + // where we may want a subdirectory structure for project files. Here we + // replace the '|' character with '/' to simulate a directory structure. const fname2 = replaceBarsWithSlashes(fname) files[fname2] = content }