Merge pull request #3233 from tridactyl/nim_native_deploy

Update nativeinstall for new Nim messenger
This commit is contained in:
Oliver Blanthorn 2021-01-21 09:14:14 +00:00 committed by GitHub
commit 673d4ee380
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 13 additions and 18 deletions

View file

@ -1 +1 @@
0.0.4
0.2.0

View file

@ -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()
}

View file

@ -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: {
"<C-6>": "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<browser.runtime.PlatformOs, default_config>
/** @hidden