Skip to content

Commit

Permalink
logging options
Browse files Browse the repository at this point in the history
  • Loading branch information
Bryan Clark committed Dec 5, 2019
1 parent bfbec53 commit 12896df
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions src/auth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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}`);
Expand Down

0 comments on commit 12896df

Please sign in to comment.