From 96e15b0f0fd9549783e2c0b3c259d959e0477593 Mon Sep 17 00:00:00 2001 From: Alexander Medvednikov Date: Sat, 22 Jun 2019 22:00:38 +0200 Subject: [PATCH] don't use /var/tmp --- compiler/main.v | 22 +++++++++++----------- os/os.v | 2 -- 2 files changed, 11 insertions(+), 13 deletions(-) diff --git a/compiler/main.v b/compiler/main.v index af08efa6a2..f1e4addeb5 100644 --- a/compiler/main.v +++ b/compiler/main.v @@ -21,10 +21,7 @@ enum BuildMode { } fn vtmp_path() string { - $if windows { - return os.home_dir() + '/.vlang$Version/' - } - return '/var/tmp/vlang$Version/' + return os.home_dir() + '/.vlang$Version/' } const ( @@ -98,16 +95,19 @@ fn main() { if '-h' in args || '--help' in args || 'help' in args { println(HelpText) } + // TODO quit if the compiler is too old // u := os.file_last_mod_unix('/var/tmp/alex') - // t := time.unixn(u) - // println(t.clean()) - // If there's not tmp path with current version yet, the user must be using a pre-built package - // Copy the `vlib` directory to the tmp path. - if !os.file_exists(TmpPath) && os.file_exists('vlib') { + // Create a temp directory if it's not there. + if !os.file_exists(TmpPath) { os.mkdir(TmpPath) - os.system2('cp -rf vlib $TmpPath/') - // os.system2('cp -rf json $TmpPath/') + } + // If there's no tmp path with current version yet, the user must be using a pre-built package + // Copy the `vlib` directory to the tmp path. +/* + // TODO + if !os.file_exists(TmpPath) && os.file_exists('vlib') { } +*/ // Just fmt and exit if args.contains('fmt') { file := args.last() diff --git a/os/os.v b/os/os.v index 3d867b3da2..927beaf20f 100644 --- a/os/os.v +++ b/os/os.v @@ -369,9 +369,7 @@ pub fn mkdir(path string) { C.CreateDirectory(path.cstr(), 0) } $else { - println('AAAAAAAA $$ "$path"') C.mkdir(path.cstr(), 511)// S_IRWXU | S_IRWXG | S_IRWXO - // os.system2('mkdir -p $path') } }