mirror of
https://github.com/xpipe-io/xpipe.git
synced 2024-11-21 23:20:23 +00:00
Fix file writing shell command
This commit is contained in:
parent
5e8dd42dd9
commit
2dabc02a3c
3 changed files with 8 additions and 8 deletions
|
@ -29,7 +29,7 @@ public interface MachineStore extends FileSystemStore, ShellStore {
|
|||
|
||||
@Override
|
||||
public default OutputStream openOutput(String file) throws Exception {
|
||||
return create().commandListFunction(proc -> proc.getShellType().createFileWriteCommand(proc.getOsType().normalizeFileName(file)))
|
||||
return create().commandFunction(proc -> proc.getShellType().createFileWriteCommand(proc.getOsType().normalizeFileName(file)))
|
||||
.startExternalStdin();
|
||||
}
|
||||
|
||||
|
|
|
@ -43,7 +43,7 @@ public interface ShellType {
|
|||
|
||||
List<String> createFileReadCommand(String file);
|
||||
|
||||
List<String> createFileWriteCommand(String file);
|
||||
String createFileWriteCommand(String file);
|
||||
|
||||
List<String> createFileExistsCommand(String file);
|
||||
|
||||
|
|
|
@ -117,8 +117,8 @@ public class ShellTypes {
|
|||
}
|
||||
|
||||
@Override
|
||||
public List<String> createFileWriteCommand(String file) {
|
||||
return List.of("findstr", "\"^\"", ">", file);
|
||||
public String createFileWriteCommand(String file) {
|
||||
return "findstr \"^\" > \"" + file + "\"";
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -233,8 +233,8 @@ public class ShellTypes {
|
|||
}
|
||||
|
||||
@Override
|
||||
public List<String> createFileWriteCommand(String file) {
|
||||
return List.of("cmd", "/c", "findstr", "\"^\"", ">", file);
|
||||
public String createFileWriteCommand(String file) {
|
||||
return "cmd /c 'findstr \"^\" > \"" + file + "\"'";
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -351,8 +351,8 @@ public class ShellTypes {
|
|||
}
|
||||
|
||||
@Override
|
||||
public List<String> createFileWriteCommand(String file) {
|
||||
return List.of("cat", ">", file);
|
||||
public String createFileWriteCommand(String file) {
|
||||
return "cat > \"" + file + "\"";
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
Loading…
Reference in a new issue