Skip to content
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
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ game-pass-api init
```

It asks a few questions (markets, language, platforms, and which properties to include) and writes a `config.json`, then offers to run it right away.
Running `game-pass-api` with no arguments and no `config.json` present starts this wizard automatically.

You can also write the `config.json` by hand - see [Configuration](#configuration) - and then run the tool:

Expand Down
5 changes: 5 additions & 0 deletions bin/cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,11 @@ program
.option('-o, --out <dir>', 'directory to write output files to (overrides outputDirectory; default: output)')
.addHelpText('after', '\nThe configuration comes from a config.json in the current directory (or --config <path>).\nRun "game-pass-api init" to create one interactively, or see the README and config.schema.json for every option.')
.action(async (options) => {
// Start the interactive wizard when invoked with no options and no config to load, but only in an interactive shell so scripts still get the friendly no-config error
if (!options.config && !options.from && !options.out && !fs.existsSync('config.json') && process.stdin.isTTY) {
await runWizard('config.json');
return;
}
const config = loadConfig(options.config);
if (options.out) {
config.outputDirectory = options.out;
Expand Down