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

后端 未结 7 2205
深忆病人
深忆病人 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:42

    You can use a repeated node, like this:

    user_dir: &user_home /home/user
    user_pics: *user_home
    

    I don't think you can concatenate though, so this wouldn't work:

    user_dir: &user_home /home/user
    user_pics: *user_home/pics
    
    0 讨论(0)
提交回复
热议问题