no message
This commit is contained in:
@@ -3,6 +3,7 @@ import Common.Utils.CommonUtils;
|
||||
import Common.Utils.Index;
|
||||
import Common.Utils.StringTemplate;
|
||||
import Common.Utils.TextLog;
|
||||
import Common.Visual.CommonUI;
|
||||
import Common_old.Constants;
|
||||
import GlobalData.GlobalDatabase;
|
||||
import _VisualDVM.Global;
|
||||
@@ -141,7 +142,7 @@ public class Utils {
|
||||
return getTempFileName(name, "");
|
||||
}
|
||||
public static boolean isAnchestor(File child, File anchestor) {
|
||||
return child.getAbsolutePath().startsWith(anchestor.getAbsolutePath() + (CommonUtils.isWindows ? "\\" : "/"));
|
||||
return child.getAbsolutePath().startsWith(anchestor.getAbsolutePath() + (CommonUtils.isWindows() ? "\\" : "/"));
|
||||
}
|
||||
//при условии что это точно его предок
|
||||
public static String getRelativeAddress(File file, File anchestor) {
|
||||
@@ -328,7 +329,7 @@ public class Utils {
|
||||
}
|
||||
public static File createScript(File scriptDirectory, File targetDirectory, String name, String scriptText) throws Exception {
|
||||
//->
|
||||
File scriptFile = Paths.get(scriptDirectory.getAbsolutePath(), name + (CommonUtils.isWindows ? ".bat" : "")).toFile();
|
||||
File scriptFile = Paths.get(scriptDirectory.getAbsolutePath(), name + (CommonUtils.isWindows() ? ".bat" : "")).toFile();
|
||||
FileUtils.write(scriptFile, "cd " + CommonUtils.DQuotes(targetDirectory.getAbsolutePath()) + "\n" + scriptText);
|
||||
if (!scriptFile.setExecutable(true)) throw new PassException("Не удалось создать исполняемый файл для скрипта");
|
||||
return scriptFile;
|
||||
@@ -529,7 +530,7 @@ public class Utils {
|
||||
}
|
||||
}
|
||||
if (sources.isEmpty()) {
|
||||
if (question) return UI.Question("Папка " + CommonUtils.Brackets(folder.getName()) + "\n" +
|
||||
if (question) return CommonUI.Question("Папка " + CommonUtils.Brackets(folder.getName()) + "\n" +
|
||||
"не содержит ни одного файла, распознанного как поддерживаемый код\n" +
|
||||
"Всё равно открыть её как проект");
|
||||
else return false;
|
||||
@@ -538,8 +539,8 @@ public class Utils {
|
||||
public static void Kill(String PID, boolean force) {
|
||||
if (!PID.isEmpty()) {
|
||||
String killCommand =
|
||||
force ? CommonUtils.isWindows ? "taskkill /PID " + CommonUtils.DQuotes(PID) + " /F /T" : "kill -9 " + CommonUtils.DQuotes(PID) :
|
||||
CommonUtils.isWindows ? "taskkill /PID " + CommonUtils.DQuotes(PID) : "kill -2 " + CommonUtils.DQuotes(PID);
|
||||
force ? CommonUtils.isWindows() ? "taskkill /PID " + CommonUtils.DQuotes(PID) + " /F /T" : "kill -9 " + CommonUtils.DQuotes(PID) :
|
||||
CommonUtils.isWindows() ? "taskkill /PID " + CommonUtils.DQuotes(PID) : "kill -2 " + CommonUtils.DQuotes(PID);
|
||||
System.out.println(killCommand);
|
||||
try {
|
||||
Process killer = Utils.startScript(Global.TempDirectory, Global.TempDirectory, "killer", killCommand);
|
||||
|
||||
Reference in New Issue
Block a user