diff --git a/packages/cli-config/package.json b/packages/cli-config/package.json index 0d9c7531d..058a519c5 100644 --- a/packages/cli-config/package.json +++ b/packages/cli-config/package.json @@ -41,7 +41,6 @@ "@oclif/config": "^1.17.0", "@percy/config": "^1.0.0-beta.31", "@percy/core": "^1.0.0-beta.31", - "@percy/logger": "^1.0.0-beta.31", - "path-type": "^4.0.0" + "@percy/logger": "^1.0.0-beta.31" } } diff --git a/packages/cli-config/src/commands/config/migrate.js b/packages/cli-config/src/commands/config/migrate.js index 5b6b86337..f6802e5ee 100644 --- a/packages/cli-config/src/commands/config/migrate.js +++ b/packages/cli-config/src/commands/config/migrate.js @@ -1,6 +1,5 @@ import fs from 'fs'; import path from 'path'; -import { isDirectorySync } from 'path-type'; import Command, { flags } from '@oclif/command'; import PercyConfig from '@percy/config'; import logger from '@percy/logger'; @@ -43,7 +42,7 @@ export class Migrate extends Command { // load config using the explorer directly rather than the load method to // better control logs and prevent validation try { - let result = !input || isDirectorySync(input) + let result = !input || fs.statSync(input).isDirectory() ? PercyConfig.explorer.search(input) : PercyConfig.explorer.load(input); diff --git a/packages/config/package.json b/packages/config/package.json index 4357cb69a..857e6eb33 100644 --- a/packages/config/package.json +++ b/packages/config/package.json @@ -28,7 +28,6 @@ "@percy/logger": "^1.0.0-beta.31", "ajv": "^7.0.3", "cosmiconfig": "^7.0.0", - "path-type": "^4.0.0", "yaml": "^1.10.0" }, "devDependencies": { diff --git a/packages/config/src/load.js b/packages/config/src/load.js index 5b626bb75..b9064ac85 100644 --- a/packages/config/src/load.js +++ b/packages/config/src/load.js @@ -1,6 +1,6 @@ import { relative } from 'path'; +import { statSync } from 'fs'; import { cosmiconfigSync } from 'cosmiconfig'; -import { isDirectorySync } from 'path-type'; import logger from '@percy/logger'; import getDefaults from './defaults'; import migrate from './migrate'; @@ -49,7 +49,7 @@ export default function load({ // load config or reload cached config if (path !== false && (!config || reload)) { try { - let result = !path || isDirectorySync(path) + let result = !path || statSync(path).isDirectory() ? explorer.search(path) : explorer.load(path); if (result && result.config) {