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

Add the Chrome OS only flag to init. #351

Merged
merged 1 commit into from
Oct 2, 2020
Merged
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
3 changes: 2 additions & 1 deletion packages/cli/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -119,11 +119,12 @@ parse the Web manifest and generate default valuers for the Android project, whe
will prompt the user to confirm or input values where one could not be generated.

```
bubblewrap init --manifest="<web-manifest-url>" [--directory="<path-to-output-location>"]
bubblewrap init --manifest="<web-manifest-url>" [--directory="<path-to-output-location>"] [--chromeosonly]
```

Options:
- `--directory`: path where to generate the project. Defaults to the current directory.
- `--chromeosonly`: this flag specifies that the build will be used for Chrome OS only and prevents non-Chrome OS devices from installing the app.

## `build`

Expand Down
3 changes: 3 additions & 0 deletions packages/cli/src/lib/cmds/init.ts
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,9 @@ export async function init(
args: ParsedArgs, config: Config, prompt: Prompt = new InquirerPrompt()): Promise<boolean> {
prompt.printMessage(messages.messageInitializingWebManifest(args.manifest));
let twaManifest = await TwaManifest.fromWebManifest(args.manifest);
if (args.chromeosonly) {
twaManifest.isChromeOSOnly = true;
}
twaManifest = await confirmTwaConfig(twaManifest, prompt);
const twaGenerator = new TwaGenerator();
const targetDirectory = args.directory || process.cwd();
Expand Down