How can I do string concatenation, or string replacement in YAML?

后端 未结 7 2249
深忆病人
深忆病人 2020-12-01 08:38

I have this:

user_dir: /home/user
user_pics: /home/user/pics

How could I use the user_dir for user_pics? If I have to specify

7条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2020-12-01 09:27

    I would use an array, then join the string together with the current OS Separator Symbol

    like this:

    default: &default_path "you should not use paths in config"
    pictures:
      - *default_path
      - pics
    

提交回复
热议问题