Coreutils fixes

This commit is contained in:
crschnick 2024-11-20 08:46:25 +00:00
parent 7c14e91749
commit bc7d601747

View file

@ -1,30 +1,13 @@
package io.xpipe.app.core.check; package io.xpipe.app.core.check;
import io.xpipe.app.comp.base.MarkdownComp;
import io.xpipe.app.core.AppI18n;
import io.xpipe.app.core.AppProperties;
import io.xpipe.app.core.AppStyle;
import io.xpipe.app.core.mode.OperationMode;
import io.xpipe.app.core.window.AppWindowHelper;
import io.xpipe.app.issue.ErrorEvent; import io.xpipe.app.issue.ErrorEvent;
import io.xpipe.app.prefs.AppPrefs;
import io.xpipe.app.resources.AppResources;
import io.xpipe.app.util.PlatformState;
import io.xpipe.app.util.WindowsRegistry;
import io.xpipe.core.process.OsType; import io.xpipe.core.process.OsType;
import javafx.geometry.Insets;
import javafx.scene.control.Alert;
import javafx.scene.control.ButtonBar;
import javafx.scene.control.ButtonType;
import lombok.Getter;
import java.nio.file.Files;
import java.util.Optional;
import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeUnit;
public class AppHomebrewCoreutilsCheck { public class AppHomebrewCoreutilsCheck {
public static boolean getResult() { public static boolean hasCoreutils() {
var fc = new ProcessBuilder("which", "stat").redirectErrorStream(true); var fc = new ProcessBuilder("which", "stat").redirectErrorStream(true);
try { try {
var proc = fc.start(); var proc = fc.start();
@ -42,7 +25,7 @@ public class AppHomebrewCoreutilsCheck {
return; return;
} }
if (!getResult()) { if (hasCoreutils()) {
ErrorEvent.fromMessage("You have the homebrew coreutils package installed and added to your PATH." + ErrorEvent.fromMessage("You have the homebrew coreutils package installed and added to your PATH." +
" The coreutils commands overwrite and are incompatible to the native macOS commands, which XPipe expects." + " The coreutils commands overwrite and are incompatible to the native macOS commands, which XPipe expects." +
" Please remove the coreutils commands from your PATH prior to launching XPipe.") " Please remove the coreutils commands from your PATH prior to launching XPipe.")