update cp script to allow copying multiple files
All checks were successful
EIVE/eive-obsw/pipeline/pr-develop This commit looks good
All checks were successful
EIVE/eive-obsw/pipeline/pr-develop This commit looks good
This commit is contained in:
parent
4ca4db621a
commit
cbb8b6e16b
@ -58,7 +58,8 @@ def handle_args():
|
|||||||
)
|
)
|
||||||
# Positional argument(s)
|
# Positional argument(s)
|
||||||
parser.add_argument(
|
parser.add_argument(
|
||||||
"source", help="Source files to copy or target files to copy back to host"
|
"source", help="Source files to copy or target files to copy back to host",
|
||||||
|
nargs="+"
|
||||||
)
|
)
|
||||||
return parser.parse_args()
|
return parser.parse_args()
|
||||||
|
|
||||||
@ -71,6 +72,10 @@ def build_cmd(args):
|
|||||||
address = ""
|
address = ""
|
||||||
port_args = ""
|
port_args = ""
|
||||||
target = args.target
|
target = args.target
|
||||||
|
if args.invert and len(args.source) > 1:
|
||||||
|
print("Multiple source files not allowed for inverse copying")
|
||||||
|
sys.exit(1)
|
||||||
|
source_files = " ".join(args.source)
|
||||||
if args.flatsat:
|
if args.flatsat:
|
||||||
address = "eive@flatsat.eive.absatvirt.lw"
|
address = "eive@flatsat.eive.absatvirt.lw"
|
||||||
else:
|
else:
|
||||||
@ -89,7 +94,7 @@ def build_cmd(args):
|
|||||||
if args.invert:
|
if args.invert:
|
||||||
cmd += f"{port_args} {address}:{args.source} {target}"
|
cmd += f"{port_args} {address}:{args.source} {target}"
|
||||||
else:
|
else:
|
||||||
cmd += f"{port_args} {args.source} {address}:{target}"
|
cmd += f"{port_args} {source_files} {address}:{target}"
|
||||||
return cmd
|
return cmd
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user