use cross-env for cd and make sure values are specified

This commit is contained in:
Jonathan Rainville 2018-10-12 11:40:28 -04:00 committed by Pascal Precht
parent 0eb6067ddf
commit 43030980b1
No known key found for this signature in database
GPG Key ID: 0EE28D8D6FD85D7D
2 changed files with 3 additions and 3 deletions

View File

@ -130,7 +130,7 @@ function entities(state = entitiesDefaultState, action) {
if (action[name] && action[name].length === 1) { if (action[name] && action[name].length === 1) {
let entity = action[name][0]; let entity = action[name][0];
let nested = Object.keys(state).reduce((acc, entityName) => { let nested = Object.keys(state).reduce((acc, entityName) => {
if (entity[entityName] && entity[entityName].length > 0) { if (entity && entity[entityName] && entity[entityName].length > 0) {
let entityFilter = filtrer[entityName] || (() => true); let entityFilter = filtrer[entityName] || (() => true);
let entitySort = sorter[entityName] || (() => true); let entitySort = sorter[entityName] || (() => true);
acc[entityName] = [...entity[entityName], ...state[entityName]].sort(entitySort).filter(entityFilter); acc[entityName] = [...entity[entityName], ...state[entityName]].sort(entitySort).filter(entityFilter);
@ -156,7 +156,7 @@ function errorEntities(state = {}, action) {
} }
let newState = {}; let newState = {};
for (let name of Object.keys(entitiesDefaultState)) { for (let name of Object.keys(entitiesDefaultState)) {
if (action[name] && action[name].length > 0) { if (action[name] && action[name].length > 0 && action[name][0]) {
newState[name] = action[name][0].error; newState[name] = action[name][0].error;
} }
} }

View File

@ -9,7 +9,7 @@
"test:test_app": "cross-env DAPP=\"test_app\" npm run test_dapp", "test:test_app": "cross-env DAPP=\"test_app\" npm run test_dapp",
"test:contracts_app": "cross-env DAPP=\"contracts_app\" npm run test_dapp", "test:contracts_app": "cross-env DAPP=\"contracts_app\" npm run test_dapp",
"test_dapp": "cross-env-shell \"cd test_apps/$DAPP && npm install && npm test\"", "test_dapp": "cross-env-shell \"cd test_apps/$DAPP && npm install && npm test\"",
"prepublish": "cd embark-ui && npm install && npm run build && cd -" "prepublish": "cross-env cd embark-ui && npm install && cd -"
}, },
"bin": { "bin": {
"embark": "./bin/embark" "embark": "./bin/embark"