diff --git a/lib/clients/rclone/config.v b/lib/clients/rclone/config.v index f6800c13..6d8e782c 100644 --- a/lib/clients/rclone/config.v +++ b/lib/clients/rclone/config.v @@ -2,8 +2,9 @@ module rclone import freeflowuniverse.herolib.core.playbook import freeflowuniverse.herolib.core.texttools +import os -const configfile = '${HOME}/.config/rclone/rclone.conf' +const configfile = '${os.home_dir()}/.config/rclone/rclone.conf' // will look for personal configuration file in ~/hero/config . // this file is in heroscript format and will have all required info to configure rclone @@ -17,13 +18,15 @@ const configfile = '${HOME}/.config/rclone/rclone.conf' // url:'' //``` pub fn configure() ! { - actions := playbook.new( - path: configfile - actor_filter: ['config'] - action_filter: [ - 's3server_define', - ] + mut plbook := playbook.new( + path: rclone.configfile + // actor_filter: ['config'] + // action_filter: [ + // 's3server_define', + // ] )! + + actions := plbook.find(filter: 'config.s3server_define')! mut out := '' for action in actions { mut name := action.params.get_default('name', '')! diff --git a/lib/clients/rclone/rclone.v b/lib/clients/rclone/rclone.v index 99caf1b7..ffe44013 100644 --- a/lib/clients/rclone/rclone.v +++ b/lib/clients/rclone/rclone.v @@ -1,7 +1,6 @@ module rclone import os -import freeflowuniverse.herolib.core.texttools // // RCloneClient represents a configured rclone instance // pub struct RCloneClient { diff --git a/lib/clients/rclone/rclone_factory_.v b/lib/clients/rclone/rclone_factory_.v index 7d18df2f..c5ac3a67 100644 --- a/lib/clients/rclone/rclone_factory_.v +++ b/lib/clients/rclone/rclone_factory_.v @@ -2,7 +2,6 @@ module rclone import freeflowuniverse.herolib.core.base import freeflowuniverse.herolib.core.playbook -import freeflowuniverse.herolib.ui.console __global ( rclone_global map[string]&RCloneClient @@ -91,9 +90,9 @@ pub fn play(args_ PlayArgs) ! { if install_actions.len > 0 { for install_action in install_actions { mut p := install_action.params - mycfg := cfg_play(p)! - console.print_debug('install action rclone.configure\n${mycfg}') - set(mycfg)! + cfg_play(p)! + // console.print_debug('install action rclone.configure\n${mycfg}') + // set(mycfg)! } } } diff --git a/lib/clients/rclone/rclone_model.v b/lib/clients/rclone/rclone_model.v index a43ad437..44acf3c5 100644 --- a/lib/clients/rclone/rclone_model.v +++ b/lib/clients/rclone/rclone_model.v @@ -34,7 +34,7 @@ pub fn heroscript_default() !string { pub struct RCloneClient { pub mut: name string = 'default' - type_ string = 's3' // remote type (s3, sftp, etc) + type_ string = 's3' // remote type (s3, sftp, etc) provider string = 'aws' // provider for s3 (aws, minio, etc) access_key string // access key for authentication secret_key string // secret key for authentication @@ -44,13 +44,13 @@ pub mut: fn cfg_play(p paramsparser.Params) ! { mut mycfg := RCloneClient{ - name: p.get_default('name', 'default')! - type_: p.get_default('type', 's3')! - provider: p.get_default('provider', 'aws')! + name: p.get_default('name', 'default')! + type_: p.get_default('type', 's3')! + provider: p.get_default('provider', 'aws')! access_key: p.get('access_key')! secret_key: p.get('secret_key')! - region: p.get_default('region', 'us-east-1')! - endpoint: p.get_default('endpoint', '')! + region: p.get_default('region', 'us-east-1')! + endpoint: p.get_default('endpoint', '')! } set(mycfg)! } diff --git a/test_basic.vsh b/test_basic.vsh index 5bc85119..e3016908 100755 --- a/test_basic.vsh +++ b/test_basic.vsh @@ -141,7 +141,7 @@ fn dotest(path string, base_dir string, mut cache TestCache) ! { mut fp := flag.new_flag_parser(os.args) fp.application('test_basic') fp.description('Run tests for herolib') -remove_cache := fp.bool('r', `r`, false, 'Remove cache file before running tests', flag.FlagConfig{}) +remove_cache := fp.bool('r', `r`, false, 'Remove cache file before running tests') fp.finalize() or { eprintln(err) exit(1) @@ -204,6 +204,7 @@ timetools_test.v encoderhero/encoder_test.v encoderhero/decoder_test.v code/codeparser +gittools_test.v ' // Split tests into array and remove empty lines