Skip to content

Commit

Permalink
Feat: Add script to update the required extension version
Browse files Browse the repository at this point in the history
  • Loading branch information
WilsonZiweiWang committed Mar 4, 2024
1 parent 3a80535 commit 5fc48a9
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 2 deletions.
5 changes: 3 additions & 2 deletions integration-tests/src/runTest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import {
resolveCliArgsFromVSCodeExecutablePath,
runTests
} from '@vscode/test-electron'
import { pythonVersion, bashVersion } from './utils/version'

async function main (): Promise<void> {
try {
Expand All @@ -20,8 +21,8 @@ async function main (): Promise<void> {
cliPath,
[
...args,
'--install-extension', 'mads-hartmann.bash-ide-vscode@1.39.0',
'--install-extension', 'ms-python.python@2023.20.0'
'--install-extension', `mads-hartmann.bash-ide-vscode@${bashVersion}`,
'--install-extension', `ms-python.python@${pythonVersion}`
],
{
encoding: 'utf-8',
Expand Down
8 changes: 8 additions & 0 deletions integration-tests/src/utils/version.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
/* --------------------------------------------------------------------------------------------
* Copyright (c) 2023 Savoir-faire Linux. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
* ------------------------------------------------------------------------------------------ */

// Required extension versions
export const bashVersion = '1.39.0'
export const pythonVersion = '2024.2.1'
28 changes: 28 additions & 0 deletions scripts/update-extension-version.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#!/usr/bin/env bash

set -e

DEST="integration-tests/src/utils/version.ts"

# Keep the header
TOTAL_LINES=$(wc -l < $DEST)
LINES_TO_KEEP=$(($TOTAL_LINES - 2))
TMP="tmp.ts"
head -n $LINES_TO_KEEP $DEST > $TMP

git clone --depth 1 --filter=blob:none --sparse https://github.com/bash-lsp/bash-language-server
cd bash-language-server
git fetch --tags
echo "export const bashVersion = '$(git tag --sort=-v:refname | head -n 1 | sed "s/^vscode-client-//")'" >> ../$TMP
cd ..
rm -rf bash-language-server

git clone --depth 1 --filter=blob:none --sparse https://github.com/Microsoft/vscode-python
cd vscode-python
git fetch --tags
echo "export const pythonVersion = '$(git tag --sort=-v:refname | head -n 1 | sed "s/^v//")'" >> ../$TMP
cd ..
rm -rf vscode-python

cp $TMP $DEST
rm $TMP

0 comments on commit 5fc48a9

Please sign in to comment.