You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I tried to read a docker file as a template in my program, and replace the detail when new condition happens.but it failed when I use dump function.
My code is like:
let yaml = require('js-yaml');
let filePath = **/docker-compos-template.yaml';
let savePath = '**/docker-compose-save.yaml';
try{
let doc = yaml.safeLoad(fs.readFileSync(filePath),'utf8');
console.log(doc);
fs.writeFileSync(savePath, yaml.dump(doc), 'utf8');
}catch(e) {
console.log(e);
}
I tried to read a docker file as a template in my program, and replace the detail when new condition happens.but it failed when I use
dump
function.My code is like:
My part of my template file is :
and the translated file is:
the symbol
>-
is not defined in the template.and then will be
''
in translate files.e.g my template file is:
but the translate file is:
it seems that the symbol
''
appears randomly.Is there any good idea to help me solve these problems?
The text was updated successfully, but these errors were encountered: