Skip to content

Commit

Permalink
Update positron cli and linux package info with positron version outp…
Browse files Browse the repository at this point in the history
…ut (#5072)

## Description

- addresses #1373
- updates `positron --version`, `positron --help`, `positron-server
--version`, `positron-server --help` to output Positron version
information
- updates Linux package version info to use Positron version
- I updated our snapcraft.yml, but we don't publish on Snap yet, so it's
just a speculative change for now

## QA Notes

Please test this functionality in each of our builds across all
platforms! I've tested this with Desktop Mac and REH-Web on Ubuntu.

Note that the Command Prompt command to install `positron` in PATH is
not available on every operating system. On some platforms, it seems
that `positron` is automatically installed in the PATH upon
installation.

### Check `--version`

Sample Output:
```
Positron: 2024.11.0 build 70
Positron SHA: 5182905
Code OSS: 1.93.0
Arch: arm64
```

#### Desktop Build
1. Use the Command Prompt to `Shell Command: Install 'positron' command
in PATH` (`workbench.action.installCommandLine`)
2. Run `positron --version` in a Terminal
3. Confirm the output contains the expected information and format

#### REH or REH Web Build
1. Locate the `positron-server` executable, which will be in the `bin`
directory of the REH or REH Web binary
2. Run `positron-server --version` in a Terminal
3. Confirm the output contains the expected information and format

### Check `--help`

Sample Output:
```
Positron 2024.11.0
<REST_OF_HELP>
```

#### Desktop Build
1. Use the Command Prompt to `Shell Command: Install 'positron' command
in PATH` (`workbench.action.installCommandLine`)
2. Run `positron --help` in a Terminal
3. The first line of output should show `Positron <POSITRON_VERSION>`

#### REH or REH Web Build
1. Locate the `positron-server` executable, which will be in the `bin`
directory of REH or REH Web binary
2. Run `positron-server --help` in a Terminal
3. The first line of output should show `Positron <POSITRON_VERSION>`

### Check package info

#### DEB
1. Run `dpkg --info <POSITRON_BINARY>.deb`
2. Confirm the Version field in the output shows `<POSITRON_VERSION>
build <BUILD_NUMBER>`

Sample Output:
```
<SOME_INITIAL_INFO>
Package: positron
Version: 2024.11.0 build 16
<REST_OF_INFO>
```

#### RPM
1. Run `rpm -qi <POSITRON_BINARY>.rpm`
2. Confirm the Version field in the output shows `<POSITRON_VERSION>
build <BUILD_NUMBER>`

Sample Output:
```
Name        : positron
Version     : 2024.11.0 build 16
<REST_OF_INFO>
```
  • Loading branch information
sharon-wang authored Oct 23, 2024
1 parent 73cc8d5 commit 9a8f07a
Show file tree
Hide file tree
Showing 16 changed files with 163 additions and 25 deletions.
16 changes: 16 additions & 0 deletions build/gulpfile.reh.js
Original file line number Diff line number Diff line change
Expand Up @@ -446,11 +446,19 @@ function packageTask(type, platform, arch, sourceFolderName, destinationFolderNa
result = es.merge(result,
gulp.src('resources/server/bin/remote-cli/code.cmd', { base: '.' })
.pipe(replace('@@VERSION@@', version))
// --- Start Positron ---
.pipe(replace('@@POSITRONVERSION@@', positronVersion))
.pipe(replace('@@BUILDNUMBER@@', positronBuildNumber))
// --- End Positron ---
.pipe(replace('@@COMMIT@@', commit))
.pipe(replace('@@APPNAME@@', product.applicationName))
.pipe(rename(`bin/remote-cli/${product.applicationName}.cmd`)),
gulp.src('resources/server/bin/helpers/browser.cmd', { base: '.' })
.pipe(replace('@@VERSION@@', version))
// --- Start Positron ---
.pipe(replace('@@POSITRONVERSION@@', positronVersion))
.pipe(replace('@@BUILDNUMBER@@', positronBuildNumber))
// --- End Positron ---
.pipe(replace('@@COMMIT@@', commit))
.pipe(replace('@@APPNAME@@', product.applicationName))
.pipe(rename(`bin/helpers/browser.cmd`)),
Expand All @@ -461,12 +469,20 @@ function packageTask(type, platform, arch, sourceFolderName, destinationFolderNa
result = es.merge(result,
gulp.src(`resources/server/bin/remote-cli/${platform === 'darwin' ? 'code-darwin.sh' : 'code-linux.sh'}`, { base: '.' })
.pipe(replace('@@VERSION@@', version))
// --- Start Positron ---
.pipe(replace('@@POSITRONVERSION@@', positronVersion))
.pipe(replace('@@BUILDNUMBER@@', positronBuildNumber))
// --- End Positron ---
.pipe(replace('@@COMMIT@@', commit))
.pipe(replace('@@APPNAME@@', product.applicationName))
.pipe(rename(`bin/remote-cli/${product.applicationName}`))
.pipe(util.setExecutableBit()),
gulp.src(`resources/server/bin/helpers/${platform === 'darwin' ? 'browser-darwin.sh' : 'browser-linux.sh'}`, { base: '.' })
.pipe(replace('@@VERSION@@', version))
// --- Start Positron ---
.pipe(replace('@@POSITRONVERSION@@', positronVersion))
.pipe(replace('@@BUILDNUMBER@@', positronBuildNumber))
// --- End Positron ---
.pipe(replace('@@COMMIT@@', commit))
.pipe(replace('@@APPNAME@@', product.applicationName))
.pipe(rename(`bin/helpers/browser.sh`))
Expand Down
7 changes: 6 additions & 1 deletion build/gulpfile.vscode.js
Original file line number Diff line number Diff line change
Expand Up @@ -547,7 +547,12 @@ function packageTask(platform, arch, sourceFolderName, destinationFolderName, op
result = es.merge(result, gulp.src('resources/win32/bin/code.sh', { base: 'resources/win32' })
.pipe(replace('@@NAME@@', product.nameShort))
.pipe(replace('@@PRODNAME@@', product.nameLong))
.pipe(replace('@@VERSION@@', version))
// --- Start Positron ---
// These are commented out since they're not currently used in 'resources/win32/bin/code.sh'
// .pipe(replace('@@VERSION@@', version))
// .pipe(replace('@@POSITRONVERSION@@', positronVersion))
// .pipe(replace('@@BUILDNUMBER@@', positronBuildNumber))
// --- End Positron ---
.pipe(replace('@@COMMIT@@', commit))
.pipe(replace('@@APPNAME@@', product.applicationName))
.pipe(replace('@@SERVERDATAFOLDER@@', product.serverDataFolderName || '.vscode-remote'))
Expand Down
17 changes: 14 additions & 3 deletions build/gulpfile.vscode.linux.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,9 @@ function prepareDebPackage(arch) {
// --- End Positron ---
.pipe(replace('@@NAME@@', product.applicationName))
// --- Start Positron ---
.pipe(replace('@@VERSION@@', product.positronVersion + '-' + linuxPackageRevision))
.pipe(replace('@@VERSION@@', product.version))
.pipe(replace('@@POSITRONVERSION@@', `${product.positronVersion}+${product.positronBuildNumber}-${linuxPackageRevision}`))
.pipe(replace('@@BUILDNUMBER@@', product.positronBuildNumber))
// --- End Positron ---
.pipe(replace('@@ARCHITECTURE@@', debArch))
.pipe(replace('@@DEPENDS@@', dependencies.join(', ')))
Expand Down Expand Up @@ -222,7 +224,11 @@ function prepareRpmPackage(arch) {
.pipe(replace('@@NAME@@', product.applicationName))
.pipe(replace('@@NAME_LONG@@', product.nameLong))
.pipe(replace('@@ICON@@', product.linuxIconName))
.pipe(replace('@@VERSION@@', packageJson.version))
// --- Start Positron ---
.pipe(replace('@@VERSION@@', product.version))
.pipe(replace('@@POSITRONVERSION@@', `${product.positronVersion}+${product.positronBuildNumber}`))
.pipe(replace('@@BUILDNUMBER@@', product.positronBuildNumber))
// --- End Positron ---
.pipe(replace('@@RELEASE@@', linuxPackageRevision))
.pipe(replace('@@ARCHITECTURE@@', rpmArch))
.pipe(replace('@@LICENSE@@', product.licenseName))
Expand Down Expand Up @@ -302,7 +308,12 @@ function prepareSnapPackage(arch) {

const snapcraft = gulp.src('resources/linux/snap/snapcraft.yaml', { base: '.' })
.pipe(replace('@@NAME@@', product.applicationName))
.pipe(replace('@@VERSION@@', commit.substr(0, 8)))
// --- Start Positron ---
.pipe(replace('@@VERSION@@', product.version))
.pipe(replace('@@POSITRONVERSION@@', product.positronVersion))
.pipe(replace('@@BUILDNUMBER@@', positronBuildNumber))
.pipe(replace('@@LICENSE@@', product.licenseName))
// --- End Positron ---
// Possible run-on values https://snapcraft.io/docs/architectures
.pipe(replace('@@ARCHITECTURE@@', arch === 'x64' ? 'amd64' : arch))
.pipe(rename('snap/snapcraft.yaml'));
Expand Down
2 changes: 1 addition & 1 deletion resources/linux/debian/positron.control.template
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Package: @@NAME@@
Version: @@VERSION@@
Version: @@POSITRONVERSION@@
Section: devel
Depends: @@DEPENDS@@
Recommends: @@RECOMMENDS@@
Expand Down
2 changes: 1 addition & 1 deletion resources/linux/rpm/positron.spec.template
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Name: @@NAME@@
Version: @@VERSION@@
Version: @@POSITRONVERSION@@
Release: @@RELEASE@@.el8
Summary: A next-generation data science IDE.
Group: Development/Tools
Expand Down
10 changes: 5 additions & 5 deletions resources/linux/snap/snapcraft.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
name: @@NAME@@
version: '@@VERSION@@'
summary: Code editing. Redefined.
version: '@@POSITRONVERSION@@ build @@BUILDNUMBER@@'
summary: A next-generation data science IDE.
description: |
Visual Studio Code is a new choice of tool that combines the
simplicity of a code editor with what developers need for the core
edit-build-debug cycle.
Positron is an extensible, polyglot tool for writing code and
exploring data in Python, R, and other languages.
license: @@LICENSE@@

architectures:
- build-on: amd64
Expand Down
8 changes: 7 additions & 1 deletion resources/server/bin/helpers/browser-darwin.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,14 @@ realdir() {
ROOT="$(dirname "$(dirname "$(realdir "$0")")")"

APP_NAME="@@APPNAME@@"
# --- Start Positron ---
POSITRON_VERSION="@@POSITRONVERSION@@"
BUILD_NUMBER="@@BUILDNUMBER@@"
# --- End Positron ---
VERSION="@@VERSION@@"
COMMIT="@@COMMIT@@"
EXEC_NAME="@@APPNAME@@"
CLI_SCRIPT="$ROOT/out/server-cli.js"
"$ROOT/node" "$CLI_SCRIPT" "$APP_NAME" "$VERSION" "$COMMIT" "$EXEC_NAME" "--openExternal" "$@"
# --- Start Positron ---
"$ROOT/node" "$CLI_SCRIPT" "$APP_NAME" "$POSITRON_VERSION" "$BUILD_NUMBER" "$VERSION" "$COMMIT" "$EXEC_NAME" "--openExternal" "$@"
# --- End Positron ---
8 changes: 7 additions & 1 deletion resources/server/bin/helpers/browser-linux.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,14 @@
ROOT="$(dirname "$(dirname "$(dirname "$(readlink -f "$0")")")")"

APP_NAME="@@APPNAME@@"
# --- Start Positron ---
POSITRON_VERSION="@@POSITRONVERSION@@"
BUILD_NUMBER="@@BUILDNUMBER@@"
# --- End Positron ---
VERSION="@@VERSION@@"
COMMIT="@@COMMIT@@"
EXEC_NAME="@@APPNAME@@"
CLI_SCRIPT="$ROOT/out/server-cli.js"
"$ROOT/node" "$CLI_SCRIPT" "$APP_NAME" "$VERSION" "$COMMIT" "$EXEC_NAME" "--openExternal" "$@"
# --- Start Positron ---
"$ROOT/node" "$CLI_SCRIPT" "$APP_NAME" "$POSITRON_VERSION" "$BUILD_NUMBER" "$VERSION" "$COMMIT" "$EXEC_NAME" "--openExternal" "$@"
# --- End Positron ---
4 changes: 3 additions & 1 deletion resources/server/bin/helpers/browser.cmd
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
@echo off
setlocal
set ROOT_DIR=%~dp0..\..
start "Open Browser" /B "%ROOT_DIR%\node.exe" "%ROOT_DIR%\out\server-cli.js" "@@APPNAME@@" "@@VERSION@@" "@@COMMIT@@" "@@APPNAME@@.cmd" "--openExternal" "%*"
@REM --- Start Positron ---
start "Open Browser" /B "%ROOT_DIR%\node.exe" "%ROOT_DIR%\out\server-cli.js" "@@APPNAME@@" "@@POSITRONVERSION@@" "@@BUILDNUMBER@@" "@@VERSION@@" "@@COMMIT@@" "@@APPNAME@@.cmd" "--openExternal" "%*"
@REM --- End Positron ---
endlocal
8 changes: 7 additions & 1 deletion resources/server/bin/remote-cli/code-darwin.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,14 @@ realdir() {
ROOT="$(dirname "$(dirname "$(realdir "$0")")")"

APP_NAME="@@APPNAME@@"
# --- Start Positron ---
POSITRON_VERSION="@@POSITRONVERSION@@"
BUILD_NUMBER="@@BUILDNUMBER@@"
# --- End Positron ---
VERSION="@@VERSION@@"
COMMIT="@@COMMIT@@"
EXEC_NAME="@@APPNAME@@"
CLI_SCRIPT="$ROOT/out/server-cli.js"
"$ROOT/node" "$CLI_SCRIPT" "$APP_NAME" "$VERSION" "$COMMIT" "$EXEC_NAME" "$@"
# --- Start Positron ---
"$ROOT/node" "$CLI_SCRIPT" "$APP_NAME" "$POSITRON_VERSION" "$BUILD_NUMBER" "$VERSION" "$COMMIT" "$EXEC_NAME" "$@"
# --- End Positron ---
8 changes: 7 additions & 1 deletion resources/server/bin/remote-cli/code-linux.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,14 @@
ROOT="$(dirname "$(dirname "$(dirname "$(readlink -f "$0")")")")"

APP_NAME="@@APPNAME@@"
# --- Start Positron ---
POSITRON_VERSION="@@POSITRONVERSION@@"
BUILD_NUMBER="@@BUILDNUMBER@@"
# --- End Positron ---
VERSION="@@VERSION@@"
COMMIT="@@COMMIT@@"
EXEC_NAME="@@APPNAME@@"
CLI_SCRIPT="$ROOT/out/server-cli.js"
"$ROOT/node" "$CLI_SCRIPT" "$APP_NAME" "$VERSION" "$COMMIT" "$EXEC_NAME" "$@"
# --- Start Positron ---
"$ROOT/node" "$CLI_SCRIPT" "$APP_NAME" "$POSITRON_VERSION" "$BUILD_NUMBER" "$VERSION" "$COMMIT" "$EXEC_NAME" "$@"
# --- End Positron ---
4 changes: 3 additions & 1 deletion resources/server/bin/remote-cli/code.cmd
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
@echo off
setlocal
set ROOT_DIR=%~dp0..\..
call "%ROOT_DIR%\node.exe" "%ROOT_DIR%\out\server-cli.js" "@@APPNAME@@" "@@VERSION@@" "@@COMMIT@@" "@@APPNAME@@.cmd" %*
@REM --- Start Positron ---
call "%ROOT_DIR%\node.exe" "%ROOT_DIR%\out\server-cli.js" "@@APPNAME@@" "@@POSITRONVERSION@@" "@@BUILDNUMBER@@" "@@VERSION@@" "@@COMMIT@@" "@@APPNAME@@.cmd" %*
@REM --- End Positron ---
endlocal
16 changes: 14 additions & 2 deletions src/vs/code/node/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ import { whenDeleted, writeFileSync } from 'vs/base/node/pfs';
import { findFreePort } from 'vs/base/node/ports';
import { watchFileContents } from 'vs/platform/files/node/watcher/nodejs/nodejsWatcherLib';
import { NativeParsedArgs } from 'vs/platform/environment/common/argv';
// --- Start Positron ---
// @ts-ignore - unused import buildVersionMessage is preserved to avoid upstream merge conflicts.
// --- End Positron ---
import { buildHelpMessage, buildVersionMessage, NATIVE_CLI_COMMANDS, OPTIONS } from 'vs/platform/environment/node/argv';
import { addArg, parseCLIProcessArgv } from 'vs/platform/environment/node/argvHelper';
import { getStdinFilePath, hasStdinWithoutTty, readFromStdin, stdinDataListener } from 'vs/platform/environment/node/stdin';
Expand All @@ -29,6 +32,11 @@ import { addUNCHostToAllowlist } from 'vs/base/node/unc';
import { URI } from 'vs/base/common/uri';
import { DeferredPromise } from 'vs/base/common/async';

// --- Start Positron ---
// eslint-disable-next-line no-duplicate-imports
import { buildPositronVersionMessage } from 'vs/platform/environment/node/argv';
// --- End Positron ---

function shouldSpawnCliProcess(argv: NativeParsedArgs): boolean {
return !!argv['install-source']
|| !!argv['list-extensions']
Expand Down Expand Up @@ -90,12 +98,16 @@ export async function main(argv: string[]): Promise<any> {
// Help
if (args.help) {
const executable = `${product.applicationName}${isWindows ? '.exe' : ''}`;
console.log(buildHelpMessage(product.nameLong, executable, product.version, OPTIONS));
// --- Start Positron ---
console.log(buildHelpMessage(product.nameLong, executable, product.positronVersion, OPTIONS));
// --- End Positron ---
}

// Version Info
else if (args.version) {
console.log(buildVersionMessage(product.version, product.commit));
// --- Start Positron ---
console.log(buildPositronVersionMessage(product.positronVersion, product.positronBuildNumber, product.version, product.commit));
// --- End Positron ---
}

// Shell integration
Expand Down
34 changes: 34 additions & 0 deletions src/vs/platform/environment/node/argv.ts
Original file line number Diff line number Diff line change
Expand Up @@ -466,6 +466,40 @@ export function buildHelpMessage(productName: string, executableName: string, ve
return help.join('\n');
}

// --- Start Positron ---
/**
* @deprecated To build the Positron version message, use `buildPositronVersionMessage` instead.
*/
// --- End Positron ---
export function buildVersionMessage(version: string | undefined, commit: string | undefined): string {
return `${version || localize('unknownVersion', "Unknown version")}\n${commit || localize('unknownCommit', "Unknown commit")}\n${process.arch}`;
}

// --- Start Positron ---
export function buildPositronVersionMessage(
positronVersion: string | undefined,
positronBuildNumber: number | string | undefined,
codeOSSVersion: string | undefined,
commit: string | undefined
): string {
const positronVersionString = `${positronVersion || localize('buildPositronVersionMessage.unknownPositronVersion', "Unknown Positron version")}`;
const positronBuildString = `${positronBuildNumber === undefined ? localize('buildPositronVersionMessage.unknownBuildNumber', "Unknown build number") : positronBuildNumber}`;
const positronCommitString = `${commit || localize('buildPositronVersionMessage.unknownCommit', "Unknown commit")}`;
const codeOSSVersionString = `${codeOSSVersion || localize('buildPositronVersionMessage.unknownCodeOssVersion', "Unknown Code OSS version")}`;

/**
* Preview of version string:
* Positron: 2024.11.0 build 16
* Positron SHA: d2h9d01905129j37g1j998c654e9h6vx6168de4
* Code OSS: 1.94.0
* Arch: arm64
*/
const versionString = [
`${localize('buildPositronVersionMessage.positronVersion', "Positron: {0} build {1}", positronVersionString, positronBuildString)}`,
`${localize('buildPositronVersionMessage.positronCommit', "Positron SHA: {0}", positronCommitString)}`,
`${localize('buildPositronVersionMessage.codeOSSVersion', "Code OSS: {0}", codeOSSVersionString)}`,
`${localize('buildPositronVersionMessage.arch', "Arch: {0}", process.arch)}`,
];
return versionString.join('\n');
}
// --- End Positron ---
16 changes: 14 additions & 2 deletions src/vs/server/node/remoteExtensionHostAgentCli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@ import { DownloadService } from 'vs/platform/download/common/downloadService';
import { IDownloadService } from 'vs/platform/download/common/download';
import { IUriIdentityService } from 'vs/platform/uriIdentity/common/uriIdentity';
import { UriIdentityService } from 'vs/platform/uriIdentity/common/uriIdentityService';
// --- Start Positron ---
// @ts-ignore - unused import buildVersionMessage is preserved to avoid upstream merge conflicts.
// --- End Positron ---
import { buildHelpMessage, buildVersionMessage, OptionDescriptions } from 'vs/platform/environment/node/argv';
import { isWindows } from 'vs/base/common/platform';
import { IExtensionsScannerService } from 'vs/platform/extensionManagement/common/extensionsScannerService';
Expand All @@ -51,6 +54,11 @@ import { LoggerService } from 'vs/platform/log/node/loggerService';
import { localize } from 'vs/nls';
import { addUNCHostToAllowlist, disableUNCAccessRestrictions } from 'vs/base/node/unc';

// --- Start Positron ---
// eslint-disable-next-line no-duplicate-imports
import { buildPositronVersionMessage } from 'vs/platform/environment/node/argv';
// --- End Positron ---

class CliMain extends Disposable {

constructor(private readonly args: ServerParsedArgs, private readonly remoteDataFolder: string) {
Expand Down Expand Up @@ -182,12 +190,16 @@ function eventuallyExit(code: number): void {
export async function run(args: ServerParsedArgs, REMOTE_DATA_FOLDER: string, optionDescriptions: OptionDescriptions<ServerParsedArgs>): Promise<void> {
if (args.help) {
const executable = product.serverApplicationName + (isWindows ? '.cmd' : '');
console.log(buildHelpMessage(product.nameLong, executable, product.version, optionDescriptions, { noInputFiles: true, noPipe: true }));
// --- Start Positron ---
console.log(buildHelpMessage(product.nameLong, executable, product.positronVersion, optionDescriptions, { noInputFiles: true, noPipe: true }));
// --- End Positron ---
return;
}
// Version Info
if (args.version) {
console.log(buildVersionMessage(product.version, product.commit));
// --- Start Positron ---
console.log(buildPositronVersionMessage(product.positronVersion, product.positronBuildNumber, product.version, product.commit));
// --- End Positron ---
return;
}

Expand Down
28 changes: 24 additions & 4 deletions src/vs/server/node/server.cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,21 @@ import * as cp from 'child_process';
import * as http from 'http';
import { cwd } from 'vs/base/common/process';
import { dirname, extname, resolve, join } from 'vs/base/common/path';
// --- Start Positron ---
// @ts-ignore - unused import buildVersionMessage is preserved to avoid upstream merge conflicts.
// --- End Positron ---
import { parseArgs, buildHelpMessage, buildVersionMessage, OPTIONS, OptionDescriptions, ErrorReporter } from 'vs/platform/environment/node/argv';
import { NativeParsedArgs } from 'vs/platform/environment/common/argv';
import { createWaitMarkerFileSync } from 'vs/platform/environment/node/wait';
import { PipeCommand } from 'vs/workbench/api/node/extHostCLIServer';
import { hasStdinWithoutTty, getStdinFilePath, readFromStdin } from 'vs/platform/environment/node/stdin';
import { DeferredPromise } from 'vs/base/common/async';

// --- Start Positron ---
// eslint-disable-next-line no-duplicate-imports
import { buildPositronVersionMessage } from 'vs/platform/environment/node/argv';
// --- End Positron ---

/*
* Implements a standalone CLI app that opens VS Code from a remote terminal.
* - In integrated terminals for remote windows this connects to the remote server though a pipe.
Expand All @@ -28,6 +36,10 @@ import { DeferredPromise } from 'vs/base/common/async';
interface ProductDescription {
productName: string;
version: string;
// --- Start Positron ---
positronVersion: string;
positronBuildNumber: number | string;
// --- End Positron ---
commit: string;
executableName: string;
}
Expand Down Expand Up @@ -128,11 +140,15 @@ export async function main(desc: ProductDescription, args: string[]): Promise<vo
const verbose = !!parsedArgs['verbose'];

if (parsedArgs.help) {
console.log(buildHelpMessage(desc.productName, desc.executableName, desc.version, options));
// --- Start Positron ---
console.log(buildHelpMessage(desc.productName, desc.executableName, desc.positronVersion, options));
// --- End Positron ---
return;
}
if (parsedArgs.version) {
console.log(buildVersionMessage(desc.version, desc.commit));
// --- Start Positron ---
console.log(buildPositronVersionMessage(desc.positronVersion, desc.positronBuildNumber, desc.version, desc.commit));
// --- End Positron ---
return;
}
if (parsedArgs['locate-shell-integration-path']) {
Expand Down Expand Up @@ -494,7 +510,11 @@ function mapFileToRemoteUri(uri: string): string {
return uri.replace(/^file:\/\//, 'vscode-remote://' + cliRemoteAuthority);
}

const [, , productName, version, commit, executableName, ...remainingArgs] = process.argv;
main({ productName, version, commit, executableName }, remainingArgs).then(null, err => {
// --- Start Positron ---
// Call the CLI with the following argument order:
// (node exe), (cli script), APPNAME, POSITRONVERSION, BUILDNUMBER, VERSION, COMMIT, EXEC NAME, ...
const [, , productName, positronVersion, positronBuildNumber, version, commit, executableName, ...remainingArgs] = process.argv;
main({ productName, positronVersion, positronBuildNumber, version, commit, executableName }, remainingArgs).then(null, err => {
// --- End Positron ---
console.error(err.message || err.stack || err);
});

0 comments on commit 9a8f07a

Please sign in to comment.