mirror of
https://github.com/YunoHost/yunohost.git
synced 2024-09-03 20:06:10 +02:00
Merge pull request #1589 from YunoHost/fix-write-var-redundant-keys
[fix] Write var in files with redundants keys
This commit is contained in:
commit
b7c5913683
1 changed files with 2 additions and 2 deletions
|
@ -568,7 +568,7 @@ ynh_read_var_in_file() {
|
||||||
var_part+='\s*'
|
var_part+='\s*'
|
||||||
|
|
||||||
# Extract the part after assignation sign
|
# Extract the part after assignation sign
|
||||||
local expression_with_comment="$(tail +$line_number ${file} | grep -i -o -P $var_part'\K.*$' || echo YNH_NULL | head -n1)"
|
local expression_with_comment="$((tail +$line_number ${file} | grep -i -o -P $var_part'\K.*$' || echo YNH_NULL) | head -n1)"
|
||||||
if [[ "$expression_with_comment" == "YNH_NULL" ]]; then
|
if [[ "$expression_with_comment" == "YNH_NULL" ]]; then
|
||||||
set -o xtrace # set -x
|
set -o xtrace # set -x
|
||||||
echo YNH_NULL
|
echo YNH_NULL
|
||||||
|
@ -647,7 +647,7 @@ ynh_write_var_in_file() {
|
||||||
var_part+='\s*'
|
var_part+='\s*'
|
||||||
|
|
||||||
# Extract the part after assignation sign
|
# Extract the part after assignation sign
|
||||||
local expression_with_comment="$(tail +$line_number ${file} | grep -i -o -P $var_part'\K.*$' || echo YNH_NULL | head -n1)"
|
local expression_with_comment="$((tail +$line_number ${file} | grep -i -o -P $var_part'\K.*$' || echo YNH_NULL) | head -n1)"
|
||||||
if [[ "$expression_with_comment" == "YNH_NULL" ]]; then
|
if [[ "$expression_with_comment" == "YNH_NULL" ]]; then
|
||||||
set -o xtrace # set -x
|
set -o xtrace # set -x
|
||||||
return 1
|
return 1
|
||||||
|
|
Loading…
Add table
Reference in a new issue