-
Notifications
You must be signed in to change notification settings - Fork 88
Improve compatibility with Code-OSS #189
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
getzze
wants to merge
11
commits into
jeanp413:master
Choose a base branch
from
getzze:compat-code-oss
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
7849aa0
add a release settings to be specified for OSS version
getzze 25d8eb9
make sure the commits match to avoid Not compatible error
getzze f9df3ff
make modifying commit optional, default to false
getzze 1f0cf18
add note to readme for vscode-oss users
getzze f9f95fe
fetch release automatically from the list of vscodium github releases
getzze e42ccbe
update yarn.lock
getzze ca408bb
improve readme for vcode-oss
getzze fe29691
VSCodium new release number scheme
getzze f81afc0
update README with new vscodium download url
getzze 0f62e0a
update README with new vscodium download url
getzze 7cfdeee
fix for powershell
getzze File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,46 @@ | ||
| import fetch from 'node-fetch'; | ||
| import Log from './common/logger'; | ||
|
|
||
|
|
||
| interface githubReleasesData { | ||
| name: string; | ||
| } | ||
|
|
||
| export async function fetchRelease(version: string, logger: Log, prefix: string = '.'): Promise<string> { | ||
|
|
||
| // Fetch github releases following: https://docs.github.com/en/rest/releases/releases?apiVersion=2022-11-28 | ||
| logger.info('Fetch the last release number of VSCodium corresponding to version ' + version); | ||
|
|
||
| let release = ''; | ||
| try { | ||
| const response = await fetch("https://api.github.com/repos/VSCodium/vscodium/releases", { | ||
| method: "GET", | ||
| headers: { | ||
| "Content-Type": "application/json", | ||
| "Accept": "application/vnd.github+json", | ||
| "X-GitHub-Api-Version": "2022-11-28", | ||
| }, | ||
| }); | ||
| const data = await response.json() as Array<githubReleasesData>; | ||
| let fullVersion: string; | ||
| for (let releaseInfo of data) { | ||
| fullVersion = releaseInfo.name; | ||
| if (fullVersion.startsWith(version)) { | ||
| logger.info('found release version: ' + fullVersion); | ||
|
|
||
| // Found a version match, it is the newer | ||
| // Remove the version: 1.96.4.25026 -> .25026 | ||
| release = fullVersion.slice(version.length); | ||
| // Remove the prefix dot '.', if present: 1.96.4.25026 -> 25026 or 1.99.02277 -> 2277 | ||
| if (release.startsWith(prefix)) { | ||
| release = release.slice(prefix.length) | ||
| } | ||
| break; | ||
| } | ||
| } | ||
| } catch (error) { | ||
| logger.error('Error fetching releases:', error); | ||
| } | ||
|
|
||
| return release; | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.