remix-project mirror
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
remix-project/libs/remix-tests/src/fileSystem.ts

21 lines
491 B

6 years ago
// Extend fs
6 years ago
import path from 'path'
const fs: any = require('fs')
6 years ago
// https://github.com/mikeal/node-utils/blob/master/file/lib/main.js
fs.walkSync = function (start: string, callback) {
fs.readdirSync(start).forEach((name: string) => {
if (name === 'node_modules') {
return // hack
}
const abspath = path.join(start, name)
if (fs.statSync(abspath).isDirectory()) {
fs.walkSync(abspath, callback)
} else {
callback(abspath)
}
})
6 years ago
}
export = fs