Skip to content

Commit

Permalink
v0.9.2
Browse files Browse the repository at this point in the history
  • Loading branch information
Strum355 committed Feb 12, 2021
1 parent bbcfe00 commit 30bd0dd
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 11 deletions.
14 changes: 12 additions & 2 deletions client/src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,24 +83,34 @@ export class Extension {
if (!exists) await this.state.updateServerVersion(undefined)

const release = await getReleaseInfo(this.package.version)
log.info(`got release info from Github:\n\t`, JSON.stringify(release))

const platform = platforms[`${process.arch} ${process.platform}`]
if (platform === undefined) {
vscode.window.showErrorMessage('Unfortunately we don\'t ship binaries for your platform yet.')
log.warn(`incompatible architecture/platform:\n\t${process.arch} ${process.platform}`)
return
}

if (release.tag_name === this.state.serverVersion) return
if (release.tag_name === this.state.serverVersion) {
log.info(`server version is same as extension:\n\t`, this.state.serverVersion)
return
}

const artifact = release.assets.find(artifact => artifact.name === `mcshader-lsp-${platform}${(process.platform === 'win32' ? '.exe' : '')}`)

log.info(`artifact with url ${artifact.browser_download_url} found`)

const userResponse = await vscode.window.showInformationMessage(
this.state.serverVersion == undefined ?
`Language server version ${this.package.version} is not installed.` :
`An update is available. Upgrade from ${this.state.serverVersion} to ${release.tag_name}?`,
'Download now'
)
if (userResponse !== 'Download now') return
if (userResponse !== 'Download now') {
log.info('user chose not to download server...')
return
}

await download(artifact.browser_download_url, dest)

Expand Down
4 changes: 2 additions & 2 deletions client/src/net.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export async function getReleaseInfo(releaseTag: string): Promise<GithubRelease>

const json = await response.json()
if(!isRelease(json)) {
throw new TypeError('Received malformed request from Github Release API')
throw new TypeError('Received malformed request from Github Release API ' + JSON.stringify(json))
}
return json
}
Expand Down Expand Up @@ -72,7 +72,7 @@ async function downloadFile(

const totalBytes = Number(res.headers.get('content-length'))

log.debug('downloading file of', totalBytes, 'bytes size from', url, 'to', destFilePath)
log.debug('downloading file with', totalBytes, 'bytes size from', url, 'to', destFilePath)

let readBytes = 0
res.body.on('data', (chunk: Buffer) => {
Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 2 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "vscode-mc-shader",
"displayName": "Minecraft GLSL Shaders",
"description": "A Visual Studio Code extension for linting/etc Minecraft GLSL Shaders",
"version": "0.9.1",
"version": "0.9.2",
"publisher": "Strum355",
"author": "Noah Santschi-Cooney (Strum355)",
"license": "MIT",
Expand All @@ -19,9 +19,7 @@
],
"activationEvents": [
"onLanguage:glsl",
"workspaceContains:**/*.fsh",
"workspaceContains:**/*.vsh",
"workspaceContains:**/*.gsh"
"workspaceContains:shaders/"
],
"extensionDependencies": [
"slevesque.shader"
Expand Down
2 changes: 1 addition & 1 deletion server/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion server/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "mcshader-lsp"
version = "0.1.0"
version = "0.9.2"
authors = ["Noah Santschi-Cooney <noah@santschi-cooney.ch>"]
edition = "2018"

Expand Down

0 comments on commit 30bd0dd

Please sign in to comment.