mirror of
https://github.com/xpipe-io/xpipe.git
synced 2026-04-24 16:40:58 -04:00
Improve working directory handling if it does not exist
This commit is contained in:
@@ -28,6 +28,8 @@ public interface OsType {
|
||||
}
|
||||
}
|
||||
|
||||
String getFallbackWorkingDirectory();
|
||||
|
||||
List<String> determineInterestingPaths(ShellControl pc) throws Exception;
|
||||
|
||||
String getHomeDirectory(ShellControl pc) throws Exception;
|
||||
@@ -54,6 +56,11 @@ public interface OsType {
|
||||
|
||||
final class Windows implements OsType, Local, Any {
|
||||
|
||||
@Override
|
||||
public String getFallbackWorkingDirectory() {
|
||||
return "C:\\";
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> determineInterestingPaths(ShellControl pc) throws Exception {
|
||||
var home = getHomeDirectory(pc);
|
||||
@@ -116,6 +123,11 @@ public interface OsType {
|
||||
|
||||
class Unix implements OsType {
|
||||
|
||||
@Override
|
||||
public String getFallbackWorkingDirectory() {
|
||||
return "/";
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> determineInterestingPaths(ShellControl pc) throws Exception {
|
||||
var home = getHomeDirectory(pc);
|
||||
@@ -198,6 +210,11 @@ public interface OsType {
|
||||
|
||||
final class MacOs implements OsType, Local, Any {
|
||||
|
||||
@Override
|
||||
public String getFallbackWorkingDirectory() {
|
||||
return "/";
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> determineInterestingPaths(ShellControl pc) throws Exception {
|
||||
var home = getHomeDirectory(pc);
|
||||
|
||||
Reference in New Issue
Block a user