перенаправление вывода сборки сапфора в файлы. Осталось сделать рассылку.
This commit is contained in:
@@ -387,6 +387,25 @@ public abstract class ConnectionPass<T> extends Pass_2021<T> {
|
||||
if (!Exists(dir.parent, dir.name)) sftpChannel.mkdir(dir.full_name);
|
||||
}
|
||||
//--
|
||||
public void performScript(RemoteFile directory, String... commands) throws Exception {
|
||||
RemoteFile script_file = new RemoteFile(directory.full_name, Constants.script);
|
||||
RemoteFile out = new RemoteFile(directory.full_name, Constants.out_file);
|
||||
RemoteFile err = new RemoteFile(directory.full_name, Constants.err_file);
|
||||
//
|
||||
Vector<RemoteFile> files = new Vector<>();
|
||||
files.add(script_file);
|
||||
files.add(out);
|
||||
files.add(err);
|
||||
for (RemoteFile file : files) {
|
||||
if (Exists(directory.full_name, file.name))
|
||||
sftpChannel.rm(file.full_name);
|
||||
}
|
||||
//--
|
||||
writeToFile(String.join("\n", commands), script_file);
|
||||
//--
|
||||
ShellCommand("cd " + Utils.DQuotes(directory.full_name),
|
||||
script_file.full_name + " 1>" + Constants.out_file + " 2>" + Constants.err_file);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user