Skip to content
Snippets Groups Projects
Commit 5ec70cea authored by Michal Svamberg's avatar Michal Svamberg
Browse files

ladeni pred prezentaci

parent 31e903af
No related branches found
No related tags found
No related merge requests found
Pipeline #3650 passed
...@@ -13,18 +13,17 @@ class Method { ...@@ -13,18 +13,17 @@ class Method {
String selectCommand(bool cond, String command, String last) { String selectCommand(bool cond, String command, String last) {
if (cond == true) { if (cond == true) {
print('+ $command'); // DEBUG // print('+ $command'); // DEBUG
return (last.isEmpty) ? command : last; return (last.isEmpty) ? command : last;
} }
else { else {
print('- $command'); // DEBUG // print('- $command'); // DEBUG
return last; return last;
} }
} }
String getCommand() { String getCommand() {
String best = ''; String best = '';
print("SRC: ${src.getFqdn()} -> DST: ${dst.getFqdn()}");
best = selectCommand( best = selectCommand(
src.getFqdn() == dst.getFqdn() && src.isScpRemote(), src.getFqdn() == dst.getFqdn() && src.isScpRemote(),
"ssh ${src.getAsSsh()} 'cp ${opt.getAsCp()} ${src.getScpPath()} ${dst.getScpPath()}'", "ssh ${src.getAsSsh()} 'cp ${opt.getAsCp()} ${src.getScpPath()} ${dst.getScpPath()}'",
......
...@@ -57,7 +57,7 @@ void main() { ...@@ -57,7 +57,7 @@ void main() {
test('green example', () { test('green example', () {
expect(Optimize(Options( expect(Optimize(Options(
["/storage/brno2/home/userB/data", "/storage/brno2/project/X"], reparse: true)), ["/storage/brno2/home/userB/data", "/storage/brno2/project/X"], reparse: true)),
"ssh storage-brno6.metacentrum.cz 'cp /home/userB/data /project/X'"); "ssh storage-brno2.metacentrum.cz 'cp /home/userB/data /project/X'");
}); });
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment