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

v install: fix does not exist, when the response contained a 404 text

This commit is contained in:
Delyan Angelov 2021-02-23 08:58:26 +02:00
parent d1cebcb608
commit 7c9d280233
No known key found for this signature in database
GPG Key ID: 66886C0F12D595ED

View File

@ -17,15 +17,15 @@ const (
excluded_dirs = ['cache', 'vlib'] excluded_dirs = ['cache', 'vlib']
supported_vcs_systems = ['git', 'hg'] supported_vcs_systems = ['git', 'hg']
supported_vcs_folders = ['.git', '.hg'] supported_vcs_folders = ['.git', '.hg']
supported_vcs_update_cmds = { supported_vcs_update_cmds = map{
'git': 'git pull' 'git': 'git pull'
'hg': 'hg pull --update' 'hg': 'hg pull --update'
} }
supported_vcs_install_cmds = { supported_vcs_install_cmds = map{
'git': 'git clone --depth=1' 'git': 'git clone --depth=1'
'hg': 'hg clone' 'hg': 'hg clone'
} }
supported_vcs_outdated_steps = { supported_vcs_outdated_steps = map{
'git': ['git fetch', 'git rev-parse @', 'git rev-parse @{u}'] 'git': ['git fetch', 'git rev-parse @', 'git rev-parse @{u}']
'hg': ['hg incoming'] 'hg': ['hg incoming']
} }
@ -468,7 +468,7 @@ fn resolve_dependencies(name string, module_path string, module_names []string)
fn parse_vmod(data string) Vmod { fn parse_vmod(data string) Vmod {
keys := ['name', 'version', 'deps'] keys := ['name', 'version', 'deps']
mut m := { mut m := map{
'name': '' 'name': ''
'version': '' 'version': ''
'deps': '' 'deps': ''
@ -545,7 +545,7 @@ fn get_module_meta_info(name string) ?Mod {
errors << 'Error details: $err' errors << 'Error details: $err'
continue continue
} }
if r.status_code == 404 || r.text.contains('404') { if r.status_code == 404 {
errors << 'Skipping module "$name", since $server_url reported that "$name" does not exist.' errors << 'Skipping module "$name", since $server_url reported that "$name" does not exist.'
continue continue
} }