Commit f9b446eb authored by Roumen Petrov's avatar Roumen Petrov

use more portable "here document" in shell startup script

parent f9755422
......@@ -24,6 +24,8 @@
public class Installer {
public static final String APPINFO_COMMAND = "libexec-t1plus.so";
public static boolean install_directory(File dir, boolean share) {
if (!(dir.exists() || dir.mkdir())) return false;
......@@ -50,10 +52,15 @@ public static boolean installAppScriptFile() {
ArrayList<String> shell_script = new ArrayList<>();
String sysmkshrc = "/system/etc/mkshrc";
if (new File(sysmkshrc).exists())
if (!Application.getScriptFilePath().equals(sysmkshrc) &&
new File(sysmkshrc).exists())
shell_script.add(". " + sysmkshrc);
shell_script.add(". /proc/self/fd/0 <<< \"$(libexec-t1plus.so aliases)\"");
//Next work fine with mksh but fail with ash.
//shell_script.add(". /proc/self/fd/0 <<< \"$(libexec-t1plus.so aliases)\"");
shell_script.add(". /proc/self/fd/0 <<EOF");
shell_script.add("$(" + APPINFO_COMMAND + " aliases)");
shell_script.add("EOF");
return install_text_file(shell_script.toArray(new String[0]), Application.getScriptFile());
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment