From 36f6179a521390943350f27ab04a53789605e6ba Mon Sep 17 00:00:00 2001 From: Tim Neutkens Date: Sat, 2 Dec 2017 09:52:34 -0800 Subject: [PATCH] Check if tmpdir is writeable. Not full path --- server/build/index.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/server/build/index.js b/server/build/index.js index 10149b32..8c2261d3 100644 --- a/server/build/index.js +++ b/server/build/index.js @@ -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