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

os: filename => file_name

This commit is contained in:
yuyi
2020-03-19 22:49:07 +08:00
committed by GitHub
parent 216c7a16d8
commit 010f3efcf0
17 changed files with 20 additions and 20 deletions

View File

@ -95,7 +95,7 @@ fn worker_trunner(p mut sync.PoolProcessor, idx int, thread_id int) voidptr {
file := os.realpath(relative_file)
// Ensure that the generated binaries will be stored in the temporary folder.
// Remove them after a test passes/fails.
fname := os.filename(file)
fname := os.file_name(file)
generated_binary_fname := if os.user_os() == 'windows' { fname.replace('.v', '.exe') } else { fname.replace('.v', '') }
generated_binary_fpath := os.join_path(tmpd, generated_binary_fname)
if os.exists(generated_binary_fpath) {

View File

@ -69,7 +69,7 @@ fn main() {
scripting.used_tools_must_exist(['git', 'cc'])
mut context := Context{}
mut fp := flag.new_flag_parser(os.args)
fp.application(os.filename(os.executable()))
fp.application(os.file_name(os.executable()))
fp.version(tool_version)
fp.description(tool_description)
fp.arguments_description('VCOMMIT')

View File

@ -180,7 +180,7 @@ fn main() {
scripting.used_tools_must_exist(['cp', 'rm', 'strip', 'make', 'git', 'upx', 'cc', 'wc', 'tail', 'hyperfine'])
mut context := new_context()
mut fp := flag.new_flag_parser(os.args)
fp.application(os.filename(os.executable()))
fp.application(os.file_name(os.executable()))
fp.version(tool_version)
fp.description(tool_description)
fp.arguments_description('COMMIT_BEFORE [COMMIT_AFTER]')

View File

@ -80,7 +80,7 @@ fn (b &BenchedTests) fn_name() string {
// Called at the end of the test program produced by `v -stats file_test.v`
fn (b mut BenchedTests) end_testing() {
b.bench.stop()
println(INNER_INDENT + b.bench.total_message('running V tests in "' + os.filename(b.test_suit_file) + '"'))
println(INNER_INDENT + b.bench.total_message('running V tests in "' + os.file_name(b.test_suit_file) + '"'))
}
// ///////////////////////////////////////////////////////////////////

View File

@ -41,7 +41,7 @@ fn (context Context) footer() {
}
fn (context Context) file2v(file string) {
fname := os.filename(file)
fname := os.file_name(file)
fname_no_dots := fname.replace('.', '_')
byte_name := '${context.prefix}${fname_no_dots}'
fbytes := os.read_bytes(file) or {

View File

@ -142,7 +142,7 @@ fn init() {
exit(3)
}
mut c := Create{}
c.name = os.filename(os.getwd())
c.name = os.file_name(os.getwd())
c.description = ''
c.init_vmod()
c.init_main()

View File

@ -158,7 +158,7 @@ fn (foptions &FormatOptions) format_file(file string) {
table := table.new_table()
file_ast := parser.parse_file(file, table, .parse_comments)
formatted_content := fmt.fmt(file_ast, table)
file_name := os.filename(file)
file_name := os.file_name(file)
vfmt_output_path := os.join_path(os.temp_dir(), 'vfmt_' + file_name)
os.write_file(vfmt_output_path, formatted_content )
if foptions.is_verbose {

View File

@ -58,7 +58,7 @@ fn main(){
compiler.set_vroot_folder(os.dir(os.dir(os.dir(toolexe))))
mut fp := flag.new_flag_parser(os.args)
fp.application(os.filename(toolexe))
fp.application(os.file_name(toolexe))
fp.version( tool_version )
fp.description( tool_description )
fp.arguments_description('FILE.v/FOLDER [FILE.v/FOLDER]...')