@@ -7,7 +7,6 @@ BeginPackage[ "Wolfram`ChatbookScripts`" ];
77(*Initialization*)
88If [ ! TrueQ @ $loadedDefinitions , Get @ FileNameJoin @ { DirectoryName @ $InputFileName , "Common.wl" } ];
99If [ ! StringQ @ Environment [ "GITHUB_ACTIONS" ], System ` $PublisherID = "Wolfram" ];
10- Needs [ "Wolfram`PacletCICD`" -> "cicd`" ];
1110
1211(* ::**************************************************************************************************************:: *)
1312(* ::Subsection::Closed:: *)
@@ -16,7 +15,7 @@ $check = getBooleanArgument[ { "c", "check" }, True ];
1615$install = getBooleanArgument [ { "i" , "install" }, False ];
1716$mx = getBooleanArgument [ { "m" , "mx" }, True ];
1817$unformat = getBooleanArgument [ { "u" , "unformat" }, True ];
19- $download = getBooleanArgument [ { "s" , "snippets" }, False ];
18+ $download = getBooleanArgument [ { "s" , "snippets" }, True ];
2019
2120(* ::**************************************************************************************************************:: *)
2221(* ::Subsection::Closed:: *)
@@ -30,38 +29,6 @@ If[ $check , Get @ cFile @ FileNameJoin @ { $scriptDir, "Resources", "CodeInsp
3029(*Other*)
3130Needs [ "Wolfram`PacletCICD`" -> "cicd`" ];
3231
33- (* ::**************************************************************************************************************:: *)
34- (* ::Section::Closed:: *)
35- (*Download Snippets*)
36- $baseSnippetsURL = "https://github.com/WolframResearch/Chatbook/releases/download/" ;
37-
38- downloadSnippets [ ] :=
39- Enclose @ Module [ { targetDir , docZip , rsZip },
40- targetDir = FileNameJoin @ { $pacletDir , "Assets/Snippets/Streamable" };
41-
42- docZip = URLDownload [
43- $baseSnippetsURL <> "Snippets-Documentation-14-3-0-11967661/Documentation.zip" ,
44- FileNameJoin @ { $TemporaryDirectory , "Documentation.zip" }
45- ];
46-
47- rsZip = URLDownload [
48- $baseSnippetsURL <> "Snippets-ResourceSystem-1-0-0/ResourceSystem.zip" ,
49- FileNameJoin @ { $TemporaryDirectory , "ResourceSystem.zip" }
50- ];
51-
52- ConfirmMatch [
53- ExtractArchive [ docZip , FileNameJoin @ { targetDir , "Documentation" }, OverwriteTarget -> True ],
54- { __ String ? FileExistsQ }
55- ];
56-
57- ConfirmMatch [
58- ExtractArchive [ rsZip , FileNameJoin @ { targetDir , "ResourceSystem" }, OverwriteTarget -> True ],
59- { __ String ? FileExistsQ }
60- ];
61-
62- cicd ` ConsoleLog @ SequenceForm [ "Downloaded snippets files: " , FileNames [ All , targetDir , Infinity ] ]
63- ];
64-
6532(* ::**************************************************************************************************************:: *)
6633(* ::Section::Closed:: *)
6734(*Run*)
@@ -72,13 +39,12 @@ downloadSnippets[ ] :=
7239If [ $download ,
7340 Block [ { $ProgressReporting = True },
7441 cicd ` ConsoleLog [ "Downloading documentation snippets..." ];
75- downloadSnippets [ ]
76- (* snippetDir = cDir @ Wolfram`Chatbook`InstallDocumentationResources[ ][ "Location" ];
42+ snippetDir = cDir @ Wolfram ` Chatbook ` InstallDocumentationResources [ ][ "Location" ];
7743 targetDir = FileNameJoin @ { $pacletDir , "Assets/Snippets/Streamable" };
7844 If [ DirectoryQ @ targetDir , DeleteDirectory [ targetDir , DeleteContents -> True ] ];
7945 copied = cDir @ CopyDirectory [ snippetDir , targetDir ];
8046 cicd ` ConsoleLog @ SequenceForm [ "Copied documentation snippets to: " , copied ];
81- If[ StringQ @ Environment[ "GITHUB_ACTIONS" ], DeleteDirectory[ snippetDir, DeleteContents -> True ] ]; *)
47+ If [ StringQ @ Environment [ "GITHUB_ACTIONS" ], DeleteDirectory [ snippetDir , DeleteContents -> True ] ];
8248 ]
8349];
8450
0 commit comments