Skip to content

Commit

Permalink
cleanup, apply suggestions from last PR, fix typo
Browse files Browse the repository at this point in the history
thanks @spytheman
  • Loading branch information
ttytm committed Dec 6, 2023
1 parent 7c467e5 commit 27e71e2
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 11 deletions.
15 changes: 7 additions & 8 deletions cmd/tools/vpm/install_test.v
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ fn testsuite_end() {

fn get_vmod(path string) vmod.Manifest {
return vmod.from_file(os.join_path(test_path, path, 'v.mod')) or {
eprintln('Failed to parse v.mod for `${path}`')
eprintln('Failed to parse v.mod for `${path}`. ${err}')
exit(1)
}
}
Expand Down Expand Up @@ -167,15 +167,14 @@ fn test_install_potentially_conflicting() {

fn test_get_installed_version() {
test_project_path := os.join_path(test_path, 'test_project')
os.mkdir_all(test_project_path)!
mut res := os.execute('git init ${test_project_path}')
assert res.exit_code == 0, res.str()
os.chdir(test_project_path)!
os.write_file('v.mod', '')!
if os.getenv('CI') != '' {
os.execute_or_exit('git config --global user.email "v@vi.com"')
os.execute_or_exit('git config --global user.name "V CI"')
if os.execute('git config user.name').exit_code == 1 {
os.execute_or_exit('git config user.email "ci@vlang.com"')
os.execute_or_exit('git config user.name "V CI"')
}
mut res := os.execute('git init')
assert res.exit_code == 0, res.str()
os.write_file('v.mod', '')!
res = os.execute('git add .')
assert res.exit_code == 0, res.str()
res = os.execute('git commit -m "initial commit"')
Expand Down
2 changes: 1 addition & 1 deletion cmd/tools/vpm/install_version_input_test.v
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ fn testsuite_end() {

fn get_vmod(path string) vmod.Manifest {
return vmod.from_file(os.join_path(test_path, path, 'v.mod')) or {
eprintln('Failed to parse v.mod for `${path}`')
eprintln('Failed to parse v.mod for `${path}`. ${err}')
exit(1)
}
}
Expand Down
2 changes: 1 addition & 1 deletion cmd/tools/vpm/install_version_test.v
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ fn testsuite_end() {

fn get_vmod(path string) vmod.Manifest {
return vmod.from_file(os.join_path(test_path, path, 'v.mod')) or {
eprintln('Failed to parse v.mod for `${path}`')
eprintln('Failed to parse v.mod for `${path}`. ${err}')
exit(1)
}
}
Expand Down
2 changes: 1 addition & 1 deletion cmd/tools/vpm/parse.v
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ fn (mut p Parser) parse_module(m string) {
false
}
mut mod := if is_http || ident.starts_with('https://') {
// External module. The idenifier is an URL.
// External module. The identifier is an URL.
publisher, name := get_ident_from_url(ident) or {
vpm_error(err.msg())
p.errors++
Expand Down

0 comments on commit 27e71e2

Please sign in to comment.