always quote command since not only whitespaces require quoting

This commit is contained in:
Kris Heid 2021-03-02 10:11:00 +01:00
parent 0fe4484380
commit 423ccb3a89

View File

@ -6,10 +6,6 @@ public class Bash {
}
public static String quote(String s) {
// Check that s contains no whitespace
if (s.matches("\\S+")) {
return s;
}
return "'" + s.replace("'", "'\\''") + "'";
}
}