typo fix
This commit is contained in:
@@ -513,8 +513,9 @@ show_config() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
set_config() {
|
set_config() {
|
||||||
local key="$1" value="$2" config_file="$HOME/.finish/config"
|
local key="$1" value="$2" config_file="$HOME/.finish/config" lowercase_key
|
||||||
key=$(echo "$key" | sed 's/^[[:space:]]*//;s/[[:space:]]*$//')
|
key=$(echo "$key" | sed 's/^[[:space:]]*//;s/[[:space:]]*$//')
|
||||||
|
lowercase_key=$(echo "$key" | tr '[:upper:]' '[:lower:]')
|
||||||
key=$(echo "$key" | tr '[:lower:]' '[:upper:]' | sed 's/[^A-Z0-9]/_/g')
|
key=$(echo "$key" | tr '[:lower:]' '[:upper:]' | sed 's/[^A-Z0-9]/_/g')
|
||||||
if [ -z "$key" ]; then
|
if [ -z "$key" ]; then
|
||||||
echo_error "SyntaxError: expected 'finish config set <key> <value>'"
|
echo_error "SyntaxError: expected 'finish config set <key> <value>'"
|
||||||
@@ -524,7 +525,7 @@ set_config() {
|
|||||||
echo_error "Configuration file not found: $config_file. Run finish install."
|
echo_error "Configuration file not found: $config_file. Run finish install."
|
||||||
return
|
return
|
||||||
fi
|
fi
|
||||||
sed -i "s|^\($key:\).*|\1 $value|" "$config_file"
|
sed -i "s|^\($lowercase_key:\).*|\1 $value|" "$config_file"
|
||||||
acsh_load_config
|
acsh_load_config
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user