-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #225 from Bedrock-OSS/user-config
Add user configuration
- Loading branch information
Showing
16 changed files
with
891 additions
and
239 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
--- | ||
permalink: /docs/user_config | ||
layout: single | ||
classes: wide | ||
title: User Configuration | ||
sidebar: | ||
nav: "sidebar" | ||
--- | ||
|
||
User configuration file is stored in the Regolith app data folder. On Windows, it's | ||
`%localappdata%\regolith\user_config.json`**\***. The file is used to store the user | ||
preferences for Regolith. | ||
|
||
|
||
# Available Options | ||
|
||
### `use_project_app_data_storage: bool` | ||
|
||
Default: `false` | ||
|
||
If set to `true`, the Regolith projects will store their cache (filters, their dependencies, etc.) in the app data folder, instead of the `.regolith` folder in the project folder. | ||
### `username: string` | ||
|
||
Default: `"Your name"` | ||
|
||
The username of the user, which will be used in the `author` field of the `manifest.json` file when creating a new project. | ||
|
||
### `resolvers: list[string]` | ||
|
||
Default: `["github.com/Bedrock-OSS/regolith-filter-resolver/resolver.json"]` | ||
|
||
A list of resolvers, which will be used to resolve filter names to URLs for downloding when using the `regolith install` command. The default URL is always added to the end of the list. Note that the "URLs" used by the resolvers are not actual URLs. They have two parts, separated by `/`. The first part is an url to a repository on GitHub, and the second part is a path to the resolver file relative to the root of the repository. For example, the default resolver is on the `github.com/Bedrock-OSS/regolith-filter-resolver` repository, in the `resolver.json` file, but `github.com/Bedrock-OSS/regolith-filter-resolver/resolver.json` is not a valid URL. | ||
|
||
# The `regolith config` command | ||
|
||
The `regolith config` command is used to manage the user configuration of Regolith. It can access and modify | ||
the user configuration file. The data is stored in the application data folder in the | ||
"user_config.json" file. | ||
|
||
The behavior of the command changes based on the used flags and the number of provided arguments. | ||
The cheetsheet below shows the possible combinations of flags and arguments and what they do: | ||
|
||
- `regolith config` - printing all properties | ||
- `regolith config <key>` - printing specified property | ||
- `regolith config <key> <value>` - setting property value | ||
- `regolith config <key> --delete` - deleting a property | ||
- `regolith config <key> <value> --append` - appending to a list proeprty | ||
- `regolith config <key> <value> --index <index>` - replacing item in a list property | ||
- `regolith config <key> --index <index> --delete` - deleting item in a list property | ||
|
||
The commands that print text can take the `--full` flag to print configuration with the default values | ||
included (if they're not defined in the config file). Without the flag, the undefined properties | ||
will be printed as null or empty list. | ||
|
||
# The structure of the user configuration file | ||
|
||
The `user_config.json` file is just a regular JSON file without any nesting. You can edit it manually | ||
if you want to but you don't have to because everything can be done with the `regolith config` command. | ||
|
||
|
||
# Example config file | ||
```json | ||
{ | ||
"use_project_app_data_storage": false, | ||
"username": "Bedrock-OSS", | ||
"resolvers": [ | ||
"github.com/Bedrock-OSS/regolith-filter-resolver/resolver.json" | ||
] | ||
} | ||
``` | ||
|
||
---- | ||
|
||
**\*** *On other platforms you can refer to Go's [os.UserCacheDir](https://pkg.go.dev/os#UserCacheDir) documentation. It's in "regolith" subdirectory of the path returned by this function*. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.