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
2 changes: 1 addition & 1 deletion retype.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ editor:
branding:
logo: assets/logo.svg
logoDark: assets/logo-dark.svg
label: v1.3.2
label: v1.3.3

meta:
title: " - Bashly"
Expand Down
9 changes: 7 additions & 2 deletions src/advanced/validations.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ order: 80
Bashly supports custom validation functions for your arguments, flag
arguments, and environment variables. This is how it works:

1. In your bashly configuration file, arguments and flags (with arguments)
may have a `validate: function_name` option.
1. In your bashly configuration file, arguments, flags (with arguments) and
environment variables may have a `validate: function_name` option.
2. Whenever you run your script, it will look for a function with that name,
prefixed by `validate_` and will run it before allowing the user
input to pass.
Expand All @@ -36,6 +36,11 @@ validate_file_exists() {

+++

!!!success Tip
You may specify multiple validation functions by supplying an array:
`validate: [file_exists, file_is_writable]`
!!!


## Built-in Custom Validations

Expand Down
2 changes: 1 addition & 1 deletion src/configuration/argument.md
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ Non-unique values will be ignored.

### validate

[!badge String]
[!badge String / Array of Strings]

Apply a custom validation function.

Expand Down
2 changes: 1 addition & 1 deletion src/configuration/environment-variable.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ with [`default`](#default) or [`required`](#required).

### validate

[!badge String]
[!badge String / Array of Strings]

Apply a custom validation function.

Expand Down
2 changes: 1 addition & 1 deletion src/configuration/flag.md
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ specified.

### validate

[!badge String]
[!badge String / Array of Strings]

Apply a custom validation function.

Expand Down
18 changes: 17 additions & 1 deletion src/usage/settings.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,20 @@ Bashly will look for the settings file in one of these paths:
- A file named `bashly-settings.yml` in the working directory.
- A file named `settings.yml` in the working directory.

### Environment Overrides

All options in the settings file (except `env`) may be specified with an
environment suffix in order to override its value for a given environment
(`production` or `development`).

For example, when defining `formatter_production: shfmt --minify`, then
this will be the formatter used when generating the script with
`bashly generate --env production`.

Since these values take precedence over the standard values, you can define
both (i.e. `formatter: shfmt` and `formatter_production: shfmt --minify`).


!!!success YAML Tips
- The words `yes` and `no` are equivalent to `true` and `false`
- To specify a `null` value, use `~`
Expand All @@ -36,13 +50,15 @@ Bashly will look for the settings file in one of these paths:

All settings are optional (with their default values provided below), and
can also be set with an environment variable with the same name, capitalized
and prefixed by `BASHLY_` - for example: `BASHLY_SOURCE_DIR`
and prefixed by `BASHLY_` - for example: `BASHLY_SOURCE_DIR` environment
variable is the same as specifying `source_dir` in the settings file.

When setting environment variables, you can use:

- `0`, `false` or `no` to represent false
- `1`, `true` or `yes` to represent true


## Path Options

### `source_dir`
Expand Down