File tree Expand file tree Collapse file tree 5 files changed +28
-18
lines changed Expand file tree Collapse file tree 5 files changed +28
-18
lines changed Original file line number Diff line number Diff line change 1010os .chdir (f"{ dir_path } /.." )
1111
1212# Extract js for variables
13- with open ("dist/extension.cjs " , "r" ) as f :
13+ with open ("dist/utils/sharedConstants.mjs " , "r" ) as f :
1414 keep = False
1515 txt = ""
1616 for line in f .readlines ():
Original file line number Diff line number Diff line change @@ -26,15 +26,9 @@ import {
2626 GithubRepository ,
2727 getGithubReleaseByTag ,
2828 getAuthorizationHeaders ,
29- EXT_USER_AGENT ,
30- GITHUB_API_BASE_URL ,
3129 ownerOfRepository ,
3230 repoNameOfRepository ,
33- GITHUB_API_VERSION ,
34- HTTP_STATUS_UNAUTHORIZED ,
3531 githubApiUnauthorized ,
36- HTTP_STATUS_FORBIDDEN ,
37- HTTP_STATUS_OK ,
3832} from "./githubREST.mjs" ;
3933import { unxzFile , unzipFile } from "./downloadHelpers.mjs" ;
4034import type { Writable } from "stream" ;
@@ -43,6 +37,12 @@ import { got, type Progress } from "got";
4337import { pipeline as streamPipeline } from "node:stream/promises" ;
4438import {
4539 CURRENT_PYTHON_VERSION ,
40+ EXT_USER_AGENT ,
41+ GITHUB_API_BASE_URL ,
42+ GITHUB_API_VERSION ,
43+ HTTP_STATUS_FORBIDDEN ,
44+ HTTP_STATUS_OK ,
45+ HTTP_STATUS_UNAUTHORIZED ,
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 @@ -7,9 +7,11 @@ import { get } from "https";
77import { exec } from "child_process" ;
88import { HOME_VAR } from "../settings.mjs" ;
99import { unxzFile , unzipFile } from "./downloadHelpers.mjs" ;
10- import { EXT_USER_AGENT } from "./githubREST.mjs" ;
1110import { unknownErrorToString } from "./errorHelper.mjs" ;
12- import { WINDOWS_X86_GIT_DOWNLOAD_URL } from "./sharedConstants.mjs" ;
11+ import {
12+ EXT_USER_AGENT ,
13+ WINDOWS_X86_GIT_DOWNLOAD_URL ,
14+ } from "./sharedConstants.mjs" ;
1315
1416/**
1517 * Downloads and installs a portable version of Git.
Original file line number Diff line number Diff line change @@ -6,15 +6,15 @@ import GithubApiCache, {
66import { type RequestOptions , request } from "https" ;
77import { unknownErrorToString , unknownToError } from "./errorHelper.mjs" ;
88import { window } from "vscode" ;
9-
10- // TODO: move into web consts
11- export const HTTP_STATUS_OK = 200 ;
12- export const HTTP_STATUS_NOT_MODIFIED = 304 ;
13- export const HTTP_STATUS_UNAUTHORIZED = 401 ;
14- export const HTTP_STATUS_FORBIDDEN = 403 ;
15- export const EXT_USER_AGENT = "Raspberry Pi Pico VS Code Extension" ;
16- export const GITHUB_API_BASE_URL = "https://api.github.com" ;
17- export const GITHUB_API_VERSION = "2022-11-28 ";
9+ import {
10+ EXT_USER_AGENT ,
11+ GITHUB_API_BASE_URL ,
12+ GITHUB_API_VERSION ,
13+ HTTP_STATUS_FORBIDDEN ,
14+ HTTP_STATUS_NOT_MODIFIED ,
15+ HTTP_STATUS_OK ,
16+ HTTP_STATUS_UNAUTHORIZED ,
17+ } from "./sharedConstants.mjs ";
1818
1919/**
2020 * Enum containing supported repositories on GitHub.
Original file line number Diff line number Diff line change @@ -40,3 +40,11 @@ export const LICENSE_URL_7ZIP = "https://7-zip.org/license.txt";
4040export const WINDOWS_X86_7ZIP_DOWNLOAD_URL = "https://www.7-zip.org/a/7zr.exe" ;
4141
4242export const CMAKELISTS_ZEPHYR_HEADER = "#pico-zephyr-project" ;
43+
44+ export const HTTP_STATUS_OK = 200 ;
45+ export const HTTP_STATUS_NOT_MODIFIED = 304 ;
46+ export const HTTP_STATUS_UNAUTHORIZED = 401 ;
47+ export const HTTP_STATUS_FORBIDDEN = 403 ;
48+ export const EXT_USER_AGENT = "Raspberry Pi Pico VS Code Extension" ;
49+ export const GITHUB_API_BASE_URL = "https://api.github.com" ;
50+ export const GITHUB_API_VERSION = "2022-11-28" ;
You can’t perform that action at this time.
0 commit comments