Skip to content
This repository has been archived by the owner on Oct 4, 2024. It is now read-only.

dev-deploy: create neardev directory if it doesn't exist #362

Merged
merged 6 commits into from
May 13, 2020
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions commands/dev-deploy.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
const { KeyPair } = require('near-api-js');
const exitOnError = require('../utils/exit-on-error');
const connect = require('../utils/connect');
const { readFile, writeFile } = require('fs').promises;
const { readFile, writeFile, mkdir } = require('fs').promises;
const eventtracking = require('../utils/eventtracking');

module.exports = {
Expand Down Expand Up @@ -63,7 +63,11 @@ async function createDevAccountIfNeeded({ near, keyStore, networkId, init }) {
}
} catch (e) {
if (e.code === 'ENOENT') {
// Ignore as it means new account needs to be created, which happens below
// Create neardev directory, new account will be created below
try {
await mkdir('./neardev')
} catch (_) {} // if already exists, okay

} else {
throw e;
}
Expand Down