File tree Expand file tree Collapse file tree 3 files changed +24
-23
lines changed Expand file tree Collapse file tree 3 files changed +24
-23
lines changed Original file line number Diff line number Diff line change @@ -25,7 +25,6 @@ import {
2525 type GithubReleaseAssetData ,
2626 getGithubReleaseByTag ,
2727 getAuthorizationHeaders ,
28- repoNameOfRepository ,
2928 githubApiUnauthorized ,
3029} from "./githubREST.mjs" ;
3130import { unxzFile , unzipFile } from "./downloadHelpers.mjs" ;
@@ -43,6 +42,7 @@ import {
4342 HTTP_STATUS_OK ,
4443 HTTP_STATUS_UNAUTHORIZED ,
4544 ownerOfRepository ,
45+ repoNameOfRepository ,
4646 WINDOWS_ARM64_PYTHON_DOWNLOAD_URL ,
4747 WINDOWS_X86_PYTHON_DOWNLOAD_URL ,
4848} from "./sharedConstants.mjs" ;
Original file line number Diff line number Diff line change @@ -16,6 +16,7 @@ import {
1616 HTTP_STATUS_OK ,
1717 HTTP_STATUS_UNAUTHORIZED ,
1818 ownerOfRepository ,
19+ repoNameOfRepository ,
1920} from "./sharedConstants.mjs" ;
2021
2122/**
@@ -37,28 +38,6 @@ export type GithubReleaseAssetData = {
3738 id : number ;
3839} ;
3940
40- /**
41- * Convert a GithubRepository enum value to the url friendly name
42- * of the repository on GitHub it represents.
43- *
44- * @param repository The repository to get the name of
45- * @returns The name of the repository on GitHub
46- */
47- export function repoNameOfRepository ( repository : GithubRepository ) : string {
48- switch ( repository ) {
49- case GithubRepository . picoSDK :
50- return "pico-sdk" ;
51- case GithubRepository . cmake :
52- return "CMake" ;
53- case GithubRepository . ninja :
54- return "ninja" ;
55- case GithubRepository . tools :
56- return "pico-sdk-tools" ;
57- case GithubRepository . picotool :
58- return "picotool" ;
59- }
60- }
61-
6241/**
6342 * Interface for authorization headers to include in a request.
6443 */
Original file line number Diff line number Diff line change @@ -79,6 +79,28 @@ export function ownerOfRepository(repository: GithubRepository): string {
7979 }
8080}
8181
82+ /**
83+ * Convert a GithubRepository enum value to the url friendly name
84+ * of the repository on GitHub it represents.
85+ *
86+ * @param repository The repository to get the name of
87+ * @returns The name of the repository on GitHub
88+ */
89+ export function repoNameOfRepository ( repository : GithubRepository ) : string {
90+ switch ( repository ) {
91+ case GithubRepository . picoSDK :
92+ return "pico-sdk" ;
93+ case GithubRepository . cmake :
94+ return "CMake" ;
95+ case GithubRepository . ninja :
96+ return "ninja" ;
97+ case GithubRepository . tools :
98+ return "pico-sdk-tools" ;
99+ case GithubRepository . picotool :
100+ return "picotool" ;
101+ }
102+ }
103+
82104// NOTE: The primary rate limit for unauthenticated requests is 60 requests per hour.
83105export const SDK_REPOSITORY_URL = "https://github.com/raspberrypi/pico-sdk.git" ;
84106export const NINJA_REPOSITORY_URL = "https://github.com/ninja-build/ninja.git" ;
You can’t perform that action at this time.
0 commit comments