@@ -2691,10 +2691,12 @@ def test_(toolchain=None, target=None, compile_list=False, run_list=False, compi
2691
2691
dict (name = ['-m' , '--target' ], help = 'Target used for compile for target MCU. Example: K64F, NUCLEO_F401RE, NRF51822...' ),
2692
2692
dict (name = ['--profile' ], help = "" ),
2693
2693
dict (name = '--build' , help = 'Build directory. Default: build/' ),
2694
+ dict (name = '--source' , action = 'append' , help = 'Source directory. Default: . (current dir)' ),
2694
2695
help = 'device management supcommand' ,
2695
2696
hidden_aliases = ['dev-mgmt' , 'dm' ],
2696
2697
description = ("Manage Device with Palion" ))
2697
2698
def dev_mgmt (toolchain = None , target = None , source = False , profile = False , build = False ):
2699
+ orig_path = getcwd ()
2698
2700
program = Program (getcwd (), True )
2699
2701
program .check_requirements (True )
2700
2702
with cd (program .path ):
@@ -2712,20 +2714,23 @@ def dev_mgmt(toolchain=None, target=None, source=False, profile=False, build=Fal
2712
2714
build_path = build
2713
2715
elif not build and target and toolchain :
2714
2716
build_path = os .path .join (
2715
- os .path .relpath (program .path , orig_path ),
2716
- program .build_dir ,
2717
- target .upper (),
2718
- toolchain .upper ()
2719
- )
2717
+ os .path .relpath (program .path , orig_path ),
2718
+ program .build_dir ,
2719
+ target .upper (),
2720
+ toolchain .upper ()
2721
+ )
2720
2722
build_path = _safe_append_profile_to_build_path (build_path , profile )
2721
2723
else :
2722
2724
build_path = None
2723
2725
2726
+ args = remainder
2727
+ if args [0 ] in ('update' , 'create' ):
2728
+ args += (['--toolchain' , toolchain ] if toolchain else [])
2729
+ args += (['--mcu' , target ] if target else [])
2730
+ args += (['--build' , build_path ] if build_path else [])
2724
2731
popen ([python_cmd , '-u' , script ]
2725
- + (['-t' , toolchain ] if toolchain else [])
2726
- + (['-m' , target ] if target else [])
2727
- + (['--build' , build_path ] if build_path else [])
2728
- + remainder ,
2732
+ + args
2733
+ + list (chain .from_iterable (zip (repeat ('--source' ), source or []))),
2729
2734
env = program .get_env ())
2730
2735
2731
2736
# Export command
0 commit comments