From ce703fa142285151eb7c470b70bba6eaad0df8a5 Mon Sep 17 00:00:00 2001 From: sadan <117494111+sadan4@users.noreply.github.com> Date: Wed, 19 Jun 2024 02:37:19 -0400 Subject: [PATCH] add http2ssh command --- common/pkgs.nix | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/common/pkgs.nix b/common/pkgs.nix index 181fc06..a566e32 100644 --- a/common/pkgs.nix +++ b/common/pkgs.nix @@ -102,6 +102,20 @@ in wslclip -g && exit 0 fi '') + (pkgs.writeShellScriptBin "http2ssh" '' + set -euo pipefail + + if [[ -z $1 ]]; then + echo "You need to provide a remote name"; + echo "Avilable remotes"; + git remote -v; + exit 1; + fi + URL=''$(git remote get-url $1); + URL=''${URL/https:\/\//git@}; + URL=''${URL/\//:}; + '' + ) (pkgs.writeShellScriptBin "copy" '' command -v xsel > /dev/null if [[ $? -eq 0 ]]; then