.binconfig - Per-project configuration file for bin(1)
A .binconfig file may be placed in the root directory of a project. It may contain any combination of global settings (which affect Bin CLI itself) and command settings (which affect a single command).
A .binconfig file is written in INI format. The overall format is:
GLOBAL SETTINGS
[COMMAND NAME]
COMMAND SETTINGS
Each setting is written on a separate line in the format:
KEY = VALUE
Spaces are allowed around the = signs, and are automatically trimmed from the start/end of lines.
Values should not be quoted - quotes will be treated as part of the value. This avoids the need to escape inner quotes.
Boolean values can be set to true/false (recommended), yes/no, on/off or 1/0 (all case-insensitive). Anything else triggers an error.
Lines that start with ; or # are comments, which are ignored. No other lines can contain comments.
Global settings may appear at the top of a file.
Define a custom directory that contains the commands. The path is relative to the .binconfig
file.
Default: bin
Disable unique prefix matching.
Default: false
Merge the list of commands with a parent project.
If set to optional, no error will be raised if the parent project is missing. This may be useful in subprojects that have separate repositories, so you can't guarantee they will be cloned together.
Default: false
Customise the template for scripts created by --create
. It is passed to echo -e
, so you can use escape sequences such as \n
for new lines.
Default: #!/usr/bin/env bash\nset -euo pipefail\n\n
Define the command to execute (instead of creating a script in the bin/ directory).
The command is executed within a Bash shell (bash -c "$command"
), so it may contain logic operators (&&, ||), multiple commands separated by ;, and pretty much anything else that you can fit into a single line. Multi-line commands are not supported.
; Global settings
dir = scripts
exact = true
merge = true
template = #!/bin/sh\n\n
; Settings for each command (script)
[hello]
alias = hi
help = Say "Hello, World!"
[phpunit]
command = "$BIN_ROOT/vendor/bin/phpunit" "%@"