From 26475f5565d776aec6a5f344dba39450d3e41066 Mon Sep 17 00:00:00 2001 From: Oliver Blanthorn Date: Wed, 25 Apr 2018 12:44:16 +0100 Subject: [PATCH] Make native update script user configurable, give feedback --- src/config.ts | 2 ++ src/excmds.ts | 5 +++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/config.ts b/src/config.ts index bfd4e976..12122d8b 100644 --- a/src/config.ts +++ b/src/config.ts @@ -240,6 +240,8 @@ const DEFAULTS = o({ // This has to be a command that stays in the foreground for the whole editing session editorcmd: "gvim -f", browser: "firefox", + nativeinstallcmd: + "curl -fsSl https://raw.githubusercontent.com/cmcaine/tridactyl/master/native/install.sh | bash", }) /** Given an object and a target, extract the target if it exists, else return undefined diff --git a/src/excmds.ts b/src/excmds.ts index 9dbcc6a6..b32a0643 100644 --- a/src/excmds.ts +++ b/src/excmds.ts @@ -222,7 +222,7 @@ export async function native() { */ //#background export async function installnative() { - const installstr = "curl -fsSl https://raw.githubusercontent.com/cmcaine/tridactyl/master/native/install.sh | bash" + const installstr = await config.get("nativeinstallcmd") await clipboard("yank", installstr) fillcmdline("# Installation command copied to clipboard. Please paste and run it in your shell to install the native messenger.") } @@ -230,7 +230,8 @@ export async function installnative() { //#background export async function updatenative() { if (await nativegate()) { - Native.run("curl -fsSl https://raw.githubusercontent.com/cmcaine/tridactyl/master/native/install.sh | bash") + await Native.run(await config.get("nativeinstallcmd")) + native() } }