data-api-suite icon indicating copy to clipboard operation
data-api-suite copied to clipboard

Data API Migrations - Use path exists sync

Open hellotoby opened this issue 3 years ago • 1 comments

If using the data api migrations library without Typescript, migrations will fail as fs.pathExists returns a promise not a boolean.

Currently the migration will always fail in plain javascript projects with the error Error: ENOENT: no such file or directory, open '/path/to/project/tsconfig.json'

This PR changes the conditional to use fs.pathExistsSync which will return a boolean instead.

hellotoby avatar Aug 09 '21 23:08 hellotoby

Hi @hellotoby, great catch!

I'd love to merge but tests are failing: see https://github.com/marcgreenstock/data-api-suite/runs/3288104728?check_suite_focus=true#step:7:165

It appears the version of fs-extra doesn't define pathExistsSync, can you please upgrade the library.

marcgreenstock avatar Aug 10 '21 06:08 marcgreenstock