Skip to content

Commit 184611b

Browse files
committed
fixed bug arguments was wrong, update docs
1 parent 5f7935f commit 184611b

File tree

3 files changed

+69
-15
lines changed

3 files changed

+69
-15
lines changed

README.md

Lines changed: 33 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,18 +33,45 @@ This is more designed as a service, that means you can install electron but it w
3333
CommandParams
3434

3535
```ts
36-
type EventParams = ...string[] | { version: string, args: string[] }
36+
type EventParams = ...string[] | { version: string, params: string[] }
3737
```
3838
3939
## Commands
4040
41-
|name|params|return value|description|
42-
|-|-|-|-|
43-
|qmasters:electron.install|[version:string]|boolean| install passed version of electron for example v11.2.0. Default latest version which can found for electron|
44-
|qmasters:electron.run|EventParams|ChildProcess| starts electron app in specific version, all arguments passed as **...string[]** will directly passed to electron as command line arguments. Alternate to use a specific version use **{ version: string, args: string[]}** for example **{ version: "v11.2.0", args: ["file_to_execute.js", "second param"]}**. It will allways check the version which should be used is installed, if not it will install directly. If no version is passed it will take allways the latest version and install if required.|
41+
### qmasters:electron-install
42+
43+
install: electron in specifc version if not exists
44+
45+
#### @params
46+
[version:string]
47+
48+
#### @return
49+
string version which has been installed
50+
51+
### qmasters:electron-run
52+
53+
Starts electron with passed file. Second parameter is optional, if it passed as **...string[]** it will use the latest version which can be found for electron, all params will passed as command line arguments to electron.
54+
55+
To run in a specific version pass an object as second param
56+
57+
```ts
58+
{
59+
version: string,
60+
params: string[]
61+
}
62+
```
63+
64+
In both cases if electron in this version could not be found, latest electron version or passed one, it will install the required version.
65+
66+
#### @params
67+
68+
file: string, [EventParams]
69+
70+
#### @return
71+
ChildProcess
72+
4573
## Development
4674
4775
- go into src directory
4876
- npm install
4977
- start extension via F5 inside of vscode
50-

src/README.md

Lines changed: 33 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,15 +33,43 @@ This is more designed as a service, that means you can install electron but it w
3333
CommandParams
3434

3535
```ts
36-
type EventParams = ...string[] | { version: string, args: string[] }
36+
type EventParams = ...string[] | { version: string, params: string[] }
3737
```
3838
3939
## Commands
4040
41-
|name|params|return value|description|
42-
|-|-|-|-|
43-
|qmasters:electron.install|[version:string]|boolean| install passed version of electron for example v11.2.0. Default latest version which can found for electron|
44-
|qmasters:electron.run|EventParams|ChildProcess| starts electron app in specific version, all arguments passed as **...string[]** will directly passed to electron as command line arguments. Alternate to use a specific version use **{ version: string, args: string[]}** for example **{ version: "v11.2.0", args: ["file_to_execute.js", "second param"]}**. It will allways check the version which should be used is installed, if not it will install directly. If no version is passed it will take allways the latest version and install if required.|
41+
### qmasters:electron-install
42+
43+
install: electron in specifc version if not exists
44+
45+
#### @params
46+
[version:string]
47+
48+
#### @return
49+
string version which has been installed
50+
51+
### qmasters:electron-run
52+
53+
Starts electron with passed file. Second parameter is optional, if it passed as **...string[]** it will use the latest version which can be found for electron, all params will passed as command line arguments to electron.
54+
55+
To run in a specific version pass an object as second param
56+
57+
```ts
58+
{
59+
version: string,
60+
params: string[]
61+
}
62+
```
63+
64+
In both cases if electron in this version could not be found, latest electron version or passed one, it will install the required version.
65+
66+
#### @params
67+
68+
file: string, [EventParams]
69+
70+
#### @return
71+
ChildProcess
72+
4573
## Development
4674
4775
- go into src directory

src/lib/main.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
11
import "reflect-metadata";
22
import { container } from "tsyringe";
33
import * as vscode from "vscode";
4-
import { ELECTRON_ENV_VARS, ELECTRON_INSTALL_PATH, EventParams, OUTPUT_CHANNEL } from "./api";
4+
import { ELECTRON_ENV_VARS, ELECTRON_INSTALL_PATH, OUTPUT_CHANNEL } from "./api";
55

66
import { ElectronInstaller } from "./installer";
77
import { ElectronManager } from "./manager";
88

9-
109
export function activate(context: vscode.ExtensionContext) {
1110

1211
/**
@@ -48,9 +47,9 @@ export function activate(context: vscode.ExtensionContext) {
4847
let params = args;
4948

5049
if (args[0].hasOwnProperty("version") && args[0].hasOwnProperty("params")) {
51-
[version, params] = args[0]
50+
version = args[0].version
51+
params = args[0].params
5252
}
53-
5453
return electronManager.run(file, version, ...params)
5554
})
5655
]

0 commit comments

Comments
 (0)