diff --git a/native/current_native_version b/native/current_native_version index 81340c7e..0ea3a944 100644 --- a/native/current_native_version +++ b/native/current_native_version @@ -1 +1 @@ -0.0.4 +0.2.0 diff --git a/src/excmds.ts b/src/excmds.ts index f64fbd67..58974f9f 100644 --- a/src/excmds.ts +++ b/src/excmds.ts @@ -694,13 +694,11 @@ export async function native() { export async function nativeinstall() { const tag = TRI_VERSION.includes("pre") ? "master" : TRI_VERSION let done + const installstr = (await config.get("nativeinstallcmd")).replace("%TAG", tag) + await yank(installstr) if ((await browser.runtime.getPlatformInfo()).os === "win") { - const installstr = (await config.get("win_nativeinstallcmd")).replace("%WINTAG", "-Tag " + tag) - await yank(installstr) done = fillcmdline("# Installation command copied to clipboard. Please paste and run it in cmd.exe (other shells won't work) to install the native messenger.") } else { - const installstr = (await config.get("nativeinstallcmd")).replace("%TAG", tag) - await yank(installstr) done = fillcmdline("# Installation command copied to clipboard. Please paste and run it in your shell to install the native messenger.") } return done @@ -815,11 +813,7 @@ export async function updatenative(interactive = true) { if (interactive) logger.error("Updating the native messenger on OSX is broken. Please use `:installnative` instead.") return } - if ((await browser.runtime.getPlatformInfo()).os === "win") { - await Native.run((await config.get("win_nativeinstallcmd")).replace("%WINTAG", "-Tag " + tag)) - } else { - await Native.run((await config.get("nativeinstallcmd")).replace("%TAG", tag)) - } + await Native.run((await config.get("nativeinstallcmd")).replace("%TAG", tag)) if (interactive) native() } diff --git a/src/lib/config.ts b/src/lib/config.ts index fb60c9a3..a2bcb477 100644 --- a/src/lib/config.ts +++ b/src/lib/config.ts @@ -934,16 +934,11 @@ export class default_config { * Set this to something weird if you want to have fun every time Tridactyl tries to update its native messenger. * * %TAG will be replaced with your version of Tridactyl for stable builds, or "master" for beta builds + * + * NB: Windows and OSX have their own platform-specific defaults - this is used only for Linux, for now. OSX will use this eventually. */ nativeinstallcmd = - "curl -fsSl https://raw.githubusercontent.com/tridactyl/tridactyl/master/native/install.sh -o /tmp/trinativeinstall.sh && sh /tmp/trinativeinstall.sh %TAG" - - /** - * Set this to something weird if you want to have fun every time Tridactyl tries to update its native messenger. - * - * Replaces %WINTAG with "-Tag $TRI_VERSION", similarly to [[nativeinstallcmd]]. - */ - win_nativeinstallcmd = `powershell -NoProfile -Command "(New-Object System.Net.WebClient).DownloadFile('https://raw.githubusercontent.com/tridactyl/tridactyl/master/native/win_install.ps1', """$env:temp/tridactyl_installnative.ps1""")" & powershell -NoProfile -File %temp%\\tridactyl_installnative.ps1 %WINTAG & del %temp%\\tridactyl_installnative.ps1` + "curl -fsSl https://raw.githubusercontent.com/tridactyl/native_messenger/master/installers/install.sh -o /tmp/trinativeinstall.sh && sh /tmp/trinativeinstall.sh %TAG" /** * Used by :updatecheck and related built-in functionality to automatically check for updates and prompt users to upgrade. @@ -1140,6 +1135,8 @@ const platform_defaults = { ignoremaps: { "": "buffer #", } as unknown, + + nativeinstallcmd: `powershell -NoProfile -Command "(New-Object System.Net.WebClient).DownloadFile('https://raw.githubusercontent.com/tridactyl/tridactyl/master/native/win_install.ps1', """$env:temp/tridactyl_installnative.ps1""")" & powershell -NoProfile -File %temp%\\tridactyl_installnative.ps1 %TAG & del %temp%\\tridactyl_installnative.ps1`, }, linux: { nmaps: { @@ -1149,6 +1146,10 @@ const platform_defaults = { 'hint -F e => { const pos = tri.dom.getAbsoluteCentre(e); tri.excmds.exclaim_quiet("xdotool mousemove --sync " + window.devicePixelRatio * pos.x + " " + window.devicePixelRatio * pos.y + "; xdotool keydown ctrl+shift; xdotool click 1; xdotool keyup ctrl+shift")}', } as unknown, }, + mac: { + nativeinstallcmd: + "curl -fsSl https://raw.githubusercontent.com/tridactyl/tridactyl/master/native/install.sh -o /tmp/trinativeinstall.sh && sh /tmp/trinativeinstall.sh %TAG", + }, } as Record /** @hidden