aboutsummaryrefslogtreecommitdiff
path: root/editors/code/src/installation/interfaces.ts
diff options
context:
space:
mode:
authorAleksey Kladov <[email protected]>2020-03-17 11:44:31 +0000
committerAleksey Kladov <[email protected]>2020-03-19 08:04:59 +0000
commitfb6e655de8a44c65275ad45a27bf5bd684670ba0 (patch)
tree9c307ac69c8fc59465ee2fb6f9a8a619fc064167 /editors/code/src/installation/interfaces.ts
parentf0a1b64d7ee3baa7ccf980b35b85f0a4a3b85b1a (diff)
Rewrite auto-update
Everything now happens in main.ts, in the bootstrap family of functions. The current flow is: * check everything only on extension installation. * if the user is on nightly channel, try to download the nightly extension and reload. * when we install nightly extension, we persist its release id, so that we can check if the current release is different. * if server binary was not downloaded by the current version of the extension, redownload it (we persist the version of ext that downloaded the server).
Diffstat (limited to 'editors/code/src/installation/interfaces.ts')
-rw-r--r--editors/code/src/installation/interfaces.ts63
1 files changed, 0 insertions, 63 deletions
diff --git a/editors/code/src/installation/interfaces.ts b/editors/code/src/installation/interfaces.ts
deleted file mode 100644
index 1a8ea0884..000000000
--- a/editors/code/src/installation/interfaces.ts
+++ /dev/null
@@ -1,63 +0,0 @@
1export interface GithubRepo {
2 name: string;
3 owner: string;
4}
5
6/**
7 * Metadata about particular artifact retrieved from GitHub releases.
8 */
9export interface ArtifactReleaseInfo {
10 releaseDate: Date;
11 releaseName: string;
12 downloadUrl: string;
13}
14
15/**
16 * Represents the source of a an artifact which is either specified by the user
17 * explicitly, or bundled by this extension from GitHub releases.
18 */
19export type ArtifactSource = ArtifactSource.ExplicitPath | ArtifactSource.GithubRelease;
20
21export namespace ArtifactSource {
22 /**
23 * Type tag for `ArtifactSource` discriminated union.
24 */
25 export const enum Type { ExplicitPath, GithubRelease }
26
27 export interface ExplicitPath {
28 type: Type.ExplicitPath;
29
30 /**
31 * Filesystem path to the binary specified by the user explicitly.
32 */
33 path: string;
34 }
35
36 export interface GithubRelease {
37 type: Type.GithubRelease;
38
39 /**
40 * Repository where the binary is stored.
41 */
42 repo: GithubRepo;
43
44
45 // FIXME: add installationPath: string;
46
47 /**
48 * Directory on the filesystem where the bundled binary is stored.
49 */
50 dir: string;
51
52 /**
53 * Name of the binary file. It is stored under the same name on GitHub releases
54 * and in local `.dir`.
55 */
56 file: string;
57
58 /**
59 * Tag of github release that denotes a version required by this extension.
60 */
61 tag: string;
62 }
63}