Skip to content

Commit 629ca87

Browse files
committed
small changes
1 parent 3de113b commit 629ca87

File tree

1 file changed

+19
-19
lines changed

1 file changed

+19
-19
lines changed

src/lib/installer.ts

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -55,25 +55,6 @@ export class ElectronInstaller {
5555
})
5656
}
5757

58-
/**
59-
* resolve electron command by passed version
60-
*
61-
*/
62-
resolveElectronCommand(version?: string): string | undefined {
63-
const versionRequired = version ?? this.latestVersion;
64-
if (!this.installedMapInitialized) {
65-
const versionsPath = path.resolve(__dirname, 'versions')
66-
try {
67-
const data: {[key: string]: string} = JSON.parse(fs.readFileSync(versionsPath, {encoding: "utf8"}).toString())
68-
Object.keys(data).forEach((key) => this.installedMap.set(key, data[key]))
69-
this.installedMapInitialized = true
70-
} catch (error) {
71-
vscode.window.showErrorMessage(`could not find electron version ${versionRequired}`)
72-
}
73-
}
74-
return this.installedMap.get(versionRequired)
75-
}
76-
7758
/**
7859
* set latest version
7960
*
@@ -133,6 +114,25 @@ export class ElectronInstaller {
133114
return this.latestVersion
134115
}
135116

117+
/**
118+
* resolve electron command by passed version
119+
*
120+
*/
121+
resolveElectronCommand(version?: string): string | undefined {
122+
const versionRequired = version ?? this.latestVersion;
123+
if (!this.installedMapInitialized) {
124+
const versionsPath = path.resolve(__dirname, 'versions')
125+
try {
126+
const data: {[key: string]: string} = JSON.parse(fs.readFileSync(versionsPath, {encoding: "utf8"}).toString())
127+
Object.keys(data).forEach((key) => this.installedMap.set(key, data[key]))
128+
} catch (error) {
129+
vscode.window.showErrorMessage(`could not find electron version ${versionRequired}`)
130+
}
131+
this.installedMapInitialized = true
132+
}
133+
return this.installedMap.get(versionRequired)
134+
}
135+
136136
/**
137137
* check version is installed
138138
*

0 commit comments

Comments
 (0)