Skip to content
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

rev pgsqltools version to 1.10.0, update exe name, add osx ARM runtime #123

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions src/configurations/dev.config.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
{
"service": {
"downloadUrl": "https://github.com/Microsoft/pgtoolsservice/releases/download/{#version#}/pgsqltoolsservice-{#fileName#}",
"version": "v1.1.0",
"version": "v1.10.0",
"downloadFileNames": {
"Windows_7_86": "win-x86.zip",
"Windows_7_64": "win-x64.zip",
"OSX_10_11_64": "osx.tar.gz",
"OSX_10_11_ARM": "osx-arm64.tar.gz",
"CentOS_7": "linux-x64.tar.gz",
"Debian_8": "linux-x64.tar.gz",
"Fedora_23": "linux-x64.tar.gz",
Expand All @@ -17,8 +18,8 @@
},
"installDir": "../pgsqltoolsservice/{#version#}/{#platform#}",
"executableFiles": [
"pgsqltoolsservice/pgtoolsservice_main",
"pgsqltoolsservice/pgtoolsservice_main.exe"
"pgsqltoolsservice/ossdbtoolsservice_main",
"pgsqltoolsservice/ossdbtoolsservice_main.exe"
]
}
}
7 changes: 4 additions & 3 deletions src/configurations/production.config.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
{
"service": {
"downloadUrl": "https://github.com/Microsoft/pgtoolsservice/releases/download/{#version#}/pgsqltoolsservice-{#fileName#}",
"version": "v1.1.0",
"version": "v1.10.0",
"downloadFileNames": {
"Windows_7_86": "win-x86.zip",
"Windows_7_64": "win-x64.zip",
"OSX_10_11_64": "osx.tar.gz",
"OSX_10_11_ARM": "osx-arm64.tar.gz",
"CentOS_7": "linux-x64.tar.gz",
"Debian_8": "linux-x64.tar.gz",
"Fedora_23": "linux-x64.tar.gz",
Expand All @@ -17,8 +18,8 @@
},
"installDir": "../pgsqltoolsservice/{#version#}/{#platform#}",
"executableFiles": [
"pgsqltoolsservice/pgtoolsservice_main",
"pgsqltoolsservice/pgtoolsservice_main.exe"
"pgsqltoolsservice/ossdbtoolsservice_main",
"pgsqltoolsservice/ossdbtoolsservice_main.exe"
]
}
}
33 changes: 18 additions & 15 deletions src/models/platform.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ export enum Runtime {
UnknownVersion = <any>'Unknown',
Windows_7_86 = <any>'Windows_7_86',
Windows_7_64 = <any>'Windows_7_64',
OSX_10_11_64 = <any> 'OSX_10_11_64',
OSX_10_11_64 = <any>'OSX_10_11_64',
OSX_10_11_ARM = <any>'OSX_10_11_ARM',
CentOS_7 = <any>'CentOS_7',
Debian_8 = <any>'Debian_8',
Fedora_23 = <any>'Fedora_23',
Expand All @@ -36,6 +37,7 @@ export function getRuntimeDisplayName(runtime: Runtime): string {
case Runtime.Windows_7_86:
return 'Windows';
case Runtime.OSX_10_11_64:
case Runtime.OSX_10_11_ARM:
return 'OSX';
case Runtime.CentOS_7:
return 'CentOS';
Expand All @@ -54,7 +56,7 @@ export function getRuntimeDisplayName(runtime: Runtime): string {
case Runtime.Ubuntu_16:
return 'Ubuntu16';
default:
return 'Unknown';
return 'Unknown';
}
}

Expand Down Expand Up @@ -153,7 +155,7 @@ export class PlatformInformation {
throw new Error(`Unsupported platform: ${platform}`);
}

return architecturePromise.then( arch => {
return architecturePromise.then(arch => {
return distributionPromise.then(distro => {
return new PlatformInformation(platform, arch, distro);
});
Expand All @@ -162,11 +164,11 @@ export class PlatformInformation {

private static GetWindowsArchitecture(): Promise<string> {
return new Promise<string>((resolve, reject) => {
if (process.env.PROCESSOR_ARCHITECTURE === 'x86' && process.env.PROCESSOR_ARCHITEW6432 === undefined) {
resolve('x86');
} else {
resolve('x86_64');
}
if (process.env.PROCESSOR_ARCHITECTURE === 'x86' && process.env.PROCESSOR_ARCHITEW6432 === undefined) {
resolve('x86');
} else {
resolve('x86_64');
}
});
}

Expand Down Expand Up @@ -218,11 +220,12 @@ export class PlatformInformation {
throw new Error(`Unsupported Windows architecture: ${architecture}`);

case 'darwin':
if (architecture === 'x86_64') {
switch (architecture) {
// Note: We return the El Capitan RID for Sierra
return Runtime.OSX_10_11_64;
case 'x86_64': return Runtime.OSX_10_11_64;
case 'arm64': return Runtime.OSX_10_11_ARM;
default:
}

throw new Error(`Unsupported macOS architecture: ${architecture}`);

case 'linux':
Expand Down Expand Up @@ -251,10 +254,10 @@ export class PlatformInformation {

// If we got here, this is not a Linux distro or architecture that we currently support.
throw new Error(`Unsupported Linux distro: ${distribution.name}, ${distribution.version}, ${architecture}`);
default :
// If we got here, we've ended up with a platform we don't support like 'freebsd' or 'sunos'.
// Chances are, VS Code doesn't support these platforms either.
throw Error('Unsupported platform ' + platform);
default:
// If we got here, we've ended up with a platform we don't support like 'freebsd' or 'sunos'.
// Chances are, VS Code doesn't support these platforms either.
throw Error('Unsupported platform ' + platform);
}
}

Expand Down