Don't Show undefined

This commit is contained in:
Dragon Fire
2020-03-23 12:03:11 -04:00
parent afbbc9d4d3
commit eb31871aa1
+2 -1
View File
@@ -21,7 +21,8 @@ module.exports = class GenerateProcessEnvCommand extends Command {
const list = data.split('\n').map(line => {
if (!line) return '';
if (line.startsWith('#')) return line;
return `${line}"${process.env[line.replace('=', '')]}"`;
line = line.replace('=', '');
return `${line}="${process.env[line] || ''}"`;
}).join('\n');
return msg.channel.send({ files: [{ attachment: Buffer.from(list), name: 'provess.env.txt' }] });
}