1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

os,tools: add os.vtmp_dir()

Use it to consistently place all temporary files created by tests in a overridable folder specific to the user, that is easy to cleanup later.

NOTE: os.temp_dir() on macos returns `/tmp`, and using `/tmp/v` is a problem when multiple unix users are trying to access/create/write to it.
This commit is contained in:
Delyan Angelov
2022-11-03 09:24:52 +02:00
parent 509f5c7db3
commit f427a5241a
44 changed files with 114 additions and 105 deletions

View File

@@ -27,7 +27,7 @@ const (
//'integer/long.toml', // TODO https://github.com/vlang/v/issues/9507
jq = os.find_abs_path_of_executable('jq') or { '' }
compare_work_dir_root = os.join_path(os.temp_dir(), 'v', 'toml', 'burntsushi')
compare_work_dir_root = os.join_path(os.vtmp_dir(), 'v', 'toml', 'burntsushi')
// From: https://stackoverflow.com/a/38266731/1904615
jq_normalize = r'# Apply f to composite entities recursively using keys[], and to atoms
def sorted_walk(f):