Skip to content

Commit

Permalink
Merge pull request #662 from olgn/fix-child-process-call
Browse files Browse the repository at this point in the history
Fix browser webpack build errors
  • Loading branch information
olgn authored Nov 28, 2018
2 parents 5ec76dd + 5f37ce6 commit d7a00cc
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
4 changes: 4 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -67,5 +67,9 @@
},
"jest": {
"testEnvironment": "node"
},
"browser": {
"fs": false,
"child_process": false
}
}
4 changes: 2 additions & 2 deletions utils/files/remoteFiles.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
const AWS = require('aws-sdk')
const fs = require('fs')
const { execSync } = require('child_process')
const cp = require('child_process')
const Issue = require('../issues').Issue
const zlib = require('zlib')
const s3 = new AWS.S3()
Expand Down Expand Up @@ -141,7 +141,7 @@ const remoteFiles = {

// Function for calling local git-annex
callGitAnnex: function(cmd, cwd) {
const stream = execSync(cmd, {
const stream = cp.execSync(cmd, {
shell: true,
cwd,
})
Expand Down
5 changes: 2 additions & 3 deletions validators/tsv/checkAcqTimeFormat.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
const Issue = require('../../utils').issues.Issue
const dateIsValid = require('date-fns/isValid')
const parseDate = require('date-fns/parse')
const df = require('date-fns')

const checkAcqTimeFormat = function(rows, file, issues) {
const format = "yyyy-MM-dd'T'HH:mm:ss"
Expand All @@ -10,7 +9,7 @@ const checkAcqTimeFormat = function(rows, file, issues) {
testRows.map((line, i) => {
const lineValues = line.trim().split('\t')
const acqTime = lineValues[acqTimeColumn]
let isValid = dateIsValid(parseDate(acqTime, format, new Date()))
let isValid = df.isValid(df.parse(acqTime, format, new Date()))
if (acqTime === 'n/a') {
isValid = true
}
Expand Down

0 comments on commit d7a00cc

Please sign in to comment.