-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(projects): Allow multiple getters, and other new features.
Allows each "getter" in a project to be a single getter or an array of getters. This allows use to do things like check for `volta` when trying to get the node verson, and falling back to `node --version` if volta is not installed. We also allow specifying `cache.files` in a getter, to have a list of files we should check have not changed. Allow styles in default project config. These can be overridden by the "project" module.
- Loading branch information
Showing
20 changed files
with
477 additions
and
434 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -251,10 +251,14 @@ Outputs: | |
|
||
The project module works out what kind of project the current folder represents, and displays the current tooling versions. This is done through the ["projects" top-level configuration item](../projects.mdx) in `${configdir}/kitsch.yaml`. | ||
|
||
The default output of the project module will be something like "w/[email protected]" or "w/[email protected]". | ||
|
||
Each project has a unique style associated with it; the style comes from the `style` field in the `projects` map in this module. If none is specified, then it falls back to the `defaultProjectStyle` in this module. If that is also unspecified, then the style will be taken from teh top-level `projects` configuration. | ||
|
||
Configuration: | ||
|
||
- `projects` is a map where keys are project names, and values are `{ style, toolSymbol, packageManagerSymbol }` objects, which can be used to provide a custom style and symbols for existing projects on a theme-by-theme basis. | ||
- `defaultProjectStyle` is the style to use if no project-specific style is specified. | ||
- `defaultProjectStyle` is the style to use if no project-specific style is specified in `projects`. If this is also unspecified, we will fall back to the style specified in the top level `projects` configuration. | ||
|
||
Outputs: | ||
|
||
|
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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,19 @@ | ||
package getters | ||
|
||
import ( | ||
"testing" | ||
"testing/fstest" | ||
|
||
"github.com/stretchr/testify/assert" | ||
) | ||
|
||
func TestResolveFile(t *testing.T) { | ||
context := makeTestGetterContext(fstest.MapFS{}) | ||
context.env = map[string]string{ | ||
"VAR1": "foo", | ||
"VAR2": "bar", | ||
} | ||
|
||
result := resolveFile(context, "~/${VAR1}/$VAR2/baz") | ||
assert.Equal(t, "/users/jwalton/foo/bar/baz", result) | ||
} |
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.