ATL-663: Indicate alpha status. Updated the About dialog.

Signed-off-by: Akos Kitta <kittaakos@typefox.io>
This commit is contained in:
Akos Kitta
2020-11-03 16:08:19 +01:00
committed by Akos Kitta
parent 7b364ebe60
commit 874c3efa2c
13 changed files with 114 additions and 49 deletions

View File

@@ -105,9 +105,20 @@ export class ArduinoDaemonImpl implements ArduinoDaemon, BackendApplicationContr
return this._execPath;
}
async getVersion(): Promise<string> {
async getVersion(): Promise<Readonly<{ version: string, commit: string, status?: string }>> {
const execPath = await this.getExecPath();
return spawnCommand(`"${execPath}"`, ['version'], this.onError.bind(this));
const raw = await spawnCommand(`"${execPath}"`, ['version', '--format', 'json'], this.onError.bind(this));
try {
// The CLI `Info` object: https://github.com/arduino/arduino-cli/blob/17d24eb901b1fdaa5a4ec7da3417e9e460f84007/version/version.go#L31-L34
const { VersionString, Commit, Status } = JSON.parse(raw);
return {
version: VersionString,
commit: Commit,
status: Status
};
} catch {
return { version: raw, commit: raw };
}
}
protected async getSpawnArgs(): Promise<string[]> {

View File

@@ -84,7 +84,7 @@ export class ConfigServiceImpl implements BackendApplicationContribution, Config
return this.configChangeEmitter.event;
}
async getVersion(): Promise<string> {
async getVersion(): Promise<Readonly<{ version: string, commit: string, status?: string }>> {
return this.daemon.getVersion();
}