Advertisement
rdsedmundo

Parse docker environments var

Mar 14th, 2017
134
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. (() => {
  2.   const dockerEnv = prompt('', '');
  3.  
  4.   const parsed = dockerEnv
  5.     .split(';')
  6.     .reduce((carry, item) => {
  7.        console.log(item, new Date());
  8.  
  9.        carry += `${item.replace('- ', 'export ')}; `;    
  10.  
  11.        return carry;
  12.     }, '');
  13.  
  14.   console.log(parsed);
  15. })();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement