Skip to content

Commit

Permalink
remove NEAR_CLI_OPTIONS
Browse files Browse the repository at this point in the history
  • Loading branch information
icerove committed Mar 19, 2021
1 parent fc6be64 commit ebe2ede
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 8 deletions.
8 changes: 2 additions & 6 deletions utils/exit-on-error.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@ process.on('exit', () => {
detached: true,
env: {
NEAR_CLI_EVENT_ID: eventtracking.EVENT_ID_ERROR,
NEAR_CLI_EVENT_DATA: JSON.stringify(crashEventProperties),
NEAR_CLI_OPTIONS: process.env.NEAR_CLI_OPTIONS
NEAR_CLI_EVENT_DATA: JSON.stringify(crashEventProperties)
}
});
});
Expand All @@ -23,23 +22,20 @@ module.exports = (promiseFn) => async (...args) => {
process.env.NEAR_CLI_ERROR_LAST_COMMAND = command;
process.env.NEAR_CLI_NETWORK_ID = require('../get-config')()['networkId'];
const options = args[0];
const optionsAsStr = JSON.stringify(options);
const eventId = `event_id_shell_${command}_start`;
require('child_process').fork(__dirname + '/log-event.js', ['node'], {
silent: true,
detached: true,
env: {
NEAR_CLI_EVENT_ID: eventId,
NEAR_CLI_EVENT_DATA: JSON.stringify({}),
NEAR_CLI_OPTIONS: optionsAsStr
NEAR_CLI_EVENT_DATA: JSON.stringify({})
}
});
const promise = promiseFn.apply(null, args);
try {
await promise;
} catch (e) {
process.env.NEAR_CLI_LAST_ERROR = e.message;
process.env.NEAR_CLI_OPTIONS = optionsAsStr;
inspectResponse.prettyPrintError(e, options);
process.exit(1);
}
Expand Down
3 changes: 1 addition & 2 deletions utils/log-event.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,4 @@ const eventtracking = require('./eventtracking');

eventtracking.track(
process.env.NEAR_CLI_EVENT_ID,
JSON.parse(process.env.NEAR_CLI_EVENT_DATA),
JSON.parse(process.env.NEAR_CLI_OPTIONS));
JSON.parse(process.env.NEAR_CLI_EVENT_DATA));

0 comments on commit ebe2ede

Please sign in to comment.