Commit 36f6179a authored by Tim Neutkens's avatar Tim Neutkens

Check if tmpdir is writeable. Not full path

parent 8cd6bd3f
......@@ -9,10 +9,11 @@ import md5File from 'md5-file/promise'
export default async function build (dir, conf = null) {
const buildId = uuid.v4()
const buildDir = join(tmpdir(), uuid.v4())
const tempDir = tmpdir()
const buildDir = join(tempDir, uuid.v4())
try {
await fs.access(buildDir, fs.constants.W_OK)
await fs.access(tempDir, fs.constants.W_OK)
} catch (err) {
console.error(`> Failed, build directory is not writeable. https://err.sh/zeit/next.js/build-dir-not-writeable`)
throw err
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment