import * as fs from 'fs-extra';

export function createOrAppendToFile(name: string, content: string) {
  let fileContents = '';
  try {
    fileContents = fs.readFileSync(name, 'utf-8');
  } catch (e) {
    // file does not exist, create a new one
  }
  fileContents += `${content}\n`;
  fs.writeFileSync(name, fileContents);
}
