From ee740c9070ac7f6f2bd063a799e7395a387113d5 Mon Sep 17 00:00:00 2001 From: AJ ONeal Date: Wed, 3 Mar 2021 07:59:16 +0000 Subject: [PATCH] bugfix: cleanup and bugfix mutagen installer --- mutagen/README.md | 37 +++++++++++++++++++++++++++++++------ mutagen/install.ps1 | 3 +-- mutagen/install.sh | 15 ++++++++++++--- mutagen/releases.js | 3 +-- 4 files changed, 45 insertions(+), 13 deletions(-) diff --git a/mutagen/README.md b/mutagen/README.md index e887eec..39b96c4 100644 --- a/mutagen/README.md +++ b/mutagen/README.md @@ -5,71 +5,96 @@ tagline: | mutagen: Remote development tool --- -To update or switch versions, run `webi mutagen@stable` (or `@v2`, `@beta`, etc). +To update or switch versions, run `webi mutagen@stable` (or `@v2`, `@beta`, +etc). ## Cheat Sheet -> Mutagen is a new kind of remote development tool that enables your existing local tools to work with code in remote environments like cloud servers and containers. It does this by providing high-performance real-time file synchronization and flexible network forwarding. +> Mutagen is a new kind of remote development tool that enables your existing +> local tools to work with code in remote environments like cloud servers and +> containers. It does this by providing high-performance real-time file +> synchronization and flexible network forwarding. ### Creating sessions -Create a synchronization session named "web-app-code" between the local path ~/project and an SSH-accessible endpoint. + +Create a synchronization session named "web-app-code" between the local path +~/project and an SSH-accessible endpoint. + ```bash mutagen sync create --name=web-app-code ~/project user@example.org:~/project ``` -OR -Create a forwarding session named "web-app" between port 8080 on localhost and port 1313 inside a Docker container. + +OR Create a forwarding session named "web-app" between port 8080 on localhost +and port 1313 inside a Docker container. + ```bash mutagen forward create --name=web-app tcp:localhost:8080 docker://devcontainer:tcp:localhost:1313 ``` ### Listing sessions + ```bash mutagen sync list ``` + OR + ```bash mutagen forward list ``` ### Monitoring a session + ```bash mutagen sync monitor web-app-code ``` + OR + ```bash mutagen forward monitor web-app ``` ### Pausing/resuming sessions + ```bash mutagen sync pause web-app-code ``` + OR + ```bash mutagen forward pause web-app ``` + To resume replace `pause` with `resume` in the above commands ### Resetting session + ```bash mutagen sync reset web-app-code ``` ### Terminating session + ```bash mutagen sync terminate web-app-code ``` + OR + ```bash mutagen forward terminate web-app ``` For general help + ```bash mutagen --help ``` For specific command help -```bash + +```bash mutagen --help ``` diff --git a/mutagen/install.ps1 b/mutagen/install.ps1 index 51a66a6..bffc105 100644 --- a/mutagen/install.ps1 +++ b/mutagen/install.ps1 @@ -29,7 +29,6 @@ IF (!(Test-Path -Path "$pkg_src_cmd")) pushd .local\tmp - Remove-Item -Path ".\mutagen-v*" -Recurse -ErrorAction Ignore Remove-Item -Path ".\mutagen.exe" -Recurse -ErrorAction Ignore echo "Unpacking $pkg_download" @@ -37,7 +36,7 @@ IF (!(Test-Path -Path "$pkg_src_cmd")) echo "Install Location: $pkg_src_cmd" New-Item "$pkg_src_bin" -ItemType Directory -Force - Move-Item -Path ".\mutagen-*\mutagen.exe" -Destination "$pkg_src_bin" + Move-Item -Path ".\mutagen.exe" -Destination "$pkg_src_bin" popd } diff --git a/mutagen/install.sh b/mutagen/install.sh index b8ff619..b18183a 100644 --- a/mutagen/install.sh +++ b/mutagen/install.sh @@ -4,9 +4,9 @@ function __init_mutagen() { set -e set -u - ################## + ################### # Install mutagen # - ################## + ################### pkg_cmd_name="mutagen" @@ -18,13 +18,22 @@ function __init_mutagen() { pkg_src="$pkg_src_cmd" pkg_install() { + # $HOME/.local/opt/mutagen-v0.11.8/bin mkdir -p "$(dirname $pkg_src_cmd)" + # mv ./mutagen* "$HOME/.local/opt/mutagen-v0.11.8/bin/mutagen" mv ./mutagen "$pkg_src_cmd" + + # chmod a+x "$HOME/.local/opt/mutagen-v0.11.8/bin/mutagen" + chmod a+x "$pkg_src_cmd" } pkg_get_current_version() { - echo $(mutagen --version 2>/dev/null | head -n 1 | cut -d ' ' -f 2) + # 'mutagen version' has output in this format: + # 0.11.8 + # This trims it down to just the version number: + # 0.11.8 + echo $(mutagen version 2>/dev/null | head -n 1 | cut -d ' ' -f1) } } diff --git a/mutagen/releases.js b/mutagen/releases.js index a3bc8b4..96ee045 100644 --- a/mutagen/releases.js +++ b/mutagen/releases.js @@ -12,8 +12,7 @@ module.exports = function (request) { if (module === require.main) { module.exports(require('@root/request')).then(function (all) { - all = require('../_webi/normalize.js')(all); - all.releases = all.releases.slice(0, 5); + all = require('../_webi/normalize.js')._debug(all); console.info(JSON.stringify(all, null, 2)); }); } -- 2.25.1