diff --git a/packages/cli/README.md b/packages/cli/README.md index 5bfa8e59..1aae23ea 100644 --- a/packages/cli/README.md +++ b/packages/cli/README.md @@ -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="" [--directory=""] +bubblewrap init --manifest="" [--directory=""] [--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` diff --git a/packages/cli/src/lib/cmds/init.ts b/packages/cli/src/lib/cmds/init.ts index 218842f0..a4227bfa 100644 --- a/packages/cli/src/lib/cmds/init.ts +++ b/packages/cli/src/lib/cmds/init.ts @@ -188,6 +188,9 @@ export async function init( args: ParsedArgs, config: Config, prompt: Prompt = new InquirerPrompt()): Promise { 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();