1
0
Fork 0
mirror of https://github.com/terribleplan/next.js.git synced 2024-01-19 02:48:18 +00:00

Check if tmpdir is writeable. Not full path

This commit is contained in:
Tim Neutkens 2017-12-02 09:52:34 -08:00
parent 8cd6bd3fc3
commit 36f6179a52

View file

@ -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