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

os: realpath => real_path

This commit is contained in:
yuyi
2020-03-20 23:41:18 +08:00
committed by GitHub
parent 5f32663714
commit 2f27758a4b
30 changed files with 71 additions and 71 deletions

View File

@ -36,7 +36,7 @@ pub fn (ts mut TestSession) test() {
mut remaining_files := []string
for dot_relative_file in ts.files {
relative_file := dot_relative_file.replace('./', '')
file := os.realpath(relative_file)
file := os.real_path(relative_file)
$if windows {
if file.contains('sqlite') || file.contains('httpbin') {
continue
@ -92,7 +92,7 @@ fn worker_trunner(p mut sync.PoolProcessor, idx int, thread_id int) voidptr {
tls_bench.cstep = idx
dot_relative_file := p.get_string_item(idx)
relative_file := dot_relative_file.replace('./', '')
file := os.realpath(relative_file)
file := os.real_path(relative_file)
// Ensure that the generated binaries will be stored in the temporary folder.
// Remove them after a test passes/fails.
fname := os.file_name(file)

View File

@ -41,7 +41,7 @@ pub fn line_to_timestamp_and_commit(line string) (int,string) {
pub fn normalized_workpath_for_commit(workdir string, commit string) string {
nc := 'v_at_' + commit.replace('^', '_').replace('-', '_').replace('/', '_')
return os.realpath(workdir + os.path_separator + nc)
return os.real_path(workdir + os.path_separator + nc)
}
pub fn prepare_vc_source(vcdir string, cdir string, commit string) (string,string) {
@ -96,7 +96,7 @@ pub mut:
pub fn (vgit_context mut VGitContext) compile_oldv_if_needed() {
vgit_context.vexename = if os.user_os() == 'windows' { 'v.exe' } else { 'v' }
vgit_context.vexepath = os.realpath(os.join_path(vgit_context.path_v, vgit_context.vexename))
vgit_context.vexepath = os.real_path(os.join_path(vgit_context.path_v, vgit_context.vexename))
mut command_for_building_v_from_c_source := ''
mut command_for_selfbuilding := ''
if 'windows' == os.user_os() {
@ -137,7 +137,7 @@ pub fn (vgit_context mut VGitContext) compile_oldv_if_needed() {
pub fn add_common_tool_options<T>(context mut T, fp mut flag.FlagParser) []string {
tdir := os.temp_dir()
context.workdir = os.realpath(fp.string('workdir', `w`, tdir, 'A writable base folder. Default: $tdir'))
context.workdir = os.real_path(fp.string('workdir', `w`, tdir, 'A writable base folder. Default: $tdir'))
context.v_repo_url = fp.string('vrepo', 0, vgit.remote_v_repo_url, 'The url of the V repository. You can clone it locally too. See also --vcrepo below.')
context.vc_repo_url = fp.string('vcrepo', 0, vgit.remote_vc_repo_url, 'The url of the vc repository. You can clone it
${flag.SPACE}beforehand, and then just give the local folder
@ -158,11 +158,11 @@ ${flag.SPACE}to script it/run it in a restrictive vps/docker.
}
if os.is_dir(context.v_repo_url) {
context.v_repo_url = os.realpath( context.v_repo_url )
context.v_repo_url = os.real_path( context.v_repo_url )
}
if os.is_dir(context.vc_repo_url) {
context.vc_repo_url = os.realpath( context.vc_repo_url )
context.vc_repo_url = os.real_path( context.vc_repo_url )
}
commits := fp.finalize() or {

View File

@ -3,7 +3,7 @@ module vhelp
import os
pub fn show_topic(topic string) {
vexe := os.realpath(os.getenv('VEXE'))
vexe := os.real_path(os.getenv('VEXE'))
vroot := os.dir(vexe)
target_topic := os.join_path(vroot,'cmd','v','internal','help','${topic}.txt')
content := os.read_file(target_topic) or {
@ -12,4 +12,4 @@ pub fn show_topic(topic string) {
}
println(content)
}