Skip to content

Commit 51848e4

Browse files
authored
chore: drop path-type (#6591)
We can use a regular `fs.stat` to achieve this.
1 parent 7611c17 commit 51848e4

File tree

3 files changed

+7
-5
lines changed

3 files changed

+7
-5
lines changed

package-lock.json

Lines changed: 0 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/build/package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,6 @@
101101
"p-reduce": "^3.0.0",
102102
"package-directory": "^8.0.0",
103103
"path-exists": "^5.0.0",
104-
"path-type": "^6.0.0",
105104
"pretty-ms": "^9.0.0",
106105
"ps-list": "^8.0.0",
107106
"read-package-up": "^11.0.0",

packages/build/src/install/missing.js

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ import { normalize } from 'node:path'
33
import { fileURLToPath } from 'node:url'
44

55
import { pathExists } from 'path-exists'
6-
import { isFile } from 'path-type'
76

87
import { logInstallMissingPlugins, logInstallIntegrations } from '../log/messages/install.js'
98

@@ -88,8 +87,13 @@ const ensureDir = async function (logs, autoPluginsDir) {
8887

8988
// If `.netlify` exists but is not a directory, we remove it first
9089
const autoPluginsParent = normalize(`${autoPluginsDir}/..`)
91-
if (await isFile(autoPluginsParent)) {
92-
await fs.unlink(autoPluginsParent)
90+
try {
91+
const stat = await fs.stat(autoPluginsParent)
92+
if (stat.isFile()) {
93+
await fs.unlink(autoPluginsParent)
94+
}
95+
} catch {
96+
// do nothing since it doesn't exist
9397
}
9498

9599
await fs.mkdir(autoPluginsDir, { recursive: true })

0 commit comments

Comments
 (0)