We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f17f562 commit c5177e1Copy full SHA for c5177e1
app/routes/resources+/images.tsx
@@ -1,4 +1,4 @@
1
-import { promises as fs } from 'node:fs'
+import { promises as fs, constants } from 'node:fs'
2
import { invariantResponse } from '@epic-web/invariant'
3
import { getImgResponse } from 'openimg/node'
4
import { getDomainUrl } from '#app/utils/misc.tsx'
@@ -12,12 +12,12 @@ async function getCacheDir() {
12
13
let dir = './tests/fixtures/openimg'
14
if (process.env.NODE_ENV === 'production') {
15
- const exists = await fs
16
- .access('/data')
+ const isAccessible = await fs
+ .access('/data', constants.W_OK)
17
.then(() => true)
18
.catch(() => false)
19
20
- if (exists) {
+ if (isAccessible) {
21
dir = '/data/images'
22
}
23
0 commit comments