Commit 12896dfb authored by Bryan Clark's avatar Bryan Clark
Browse files

logging options

parent bfbec531
Loading
Loading
Loading
Loading

File changed.

Preview suppressed by a .gitattributes entry or the file's encoding is unsupported.

+2 −2
Changes for src/auth.ts: 2 added lines, 2 removed lines.
Original line number Diff line number Diff line
@@ -46,9 +46,9 @@ export function generate(id: string, username: string, password: string) {
async function write(directory: string, settings: string) {
  const options = {encoding: 'utf-8', flag: 'wx'}; // 'wx': Like 'w' but fails if path exists
  const location = path.join(directory, SETTINGS_FILE);
  console.log(`writing ${location}`);
  console.log(`writing ${location} with options ${options}`);
  try {
    return fs.writeFileSync(location, settings, options);
    fs.writeFileSync(location, settings, options);
  } catch (e) {
    if (e.code == fs.constants.O_EXCL) {
      console.log(`overwriting existing file ${location}`);