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 3 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
6 changes: 4 additions & 2 deletions commands/dev-deploy.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
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 { existsSync } = require('fs');
const eventtracking = require('../utils/eventtracking');

module.exports = {
Expand Down Expand Up @@ -63,7 +64,8 @@ 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
if (!existsSync('./neardev')) await mkdir('./neardev');
mikedotexe marked this conversation as resolved.
Show resolved Hide resolved
} else {
throw e;
}
Expand Down