From 6cee50afdaf6e83f4ec8fa5ba70ef02f498f9d12 Mon Sep 17 00:00:00 2001 From: mY9Yd2 <46626444+mY9Yd2@users.noreply.github.com> Date: Mon, 30 Dec 2019 05:25:26 +0100 Subject: [PATCH] os: fix tmpdir on unix --- vlib/os/os.v | 24 +++--------------------- 1 file changed, 3 insertions(+), 21 deletions(-) diff --git a/vlib/os/os.v b/vlib/os/os.v index 9f21a7e656..1c7b524a1d 100644 --- a/vlib/os/os.v +++ b/vlib/os/os.v @@ -1073,27 +1073,6 @@ pub fn join(base string, dirs ...string) string { // tmpdir returns the path to a folder, that is suitable for storing temporary files pub fn tmpdir() string { mut path := os.getenv('TMPDIR') - $if linux { - if path == '' { - path = '/tmp' - } - } - $if freebsd { - if path == '' { - path = '/tmp' - } - } - $if macos { - /* - if path == '' { - // TODO untested - path = C.NSTemporaryDirectory() - } - */ - if path == '' { - path = '/tmp' - } - } $if windows { if path == '' { // TODO see Qt's implementation? @@ -1108,6 +1087,9 @@ pub fn tmpdir() string { } } } + if path == '' { + path = '/tmp' + } return path }