From 9a6089289dd3df344ff3acbedcd10c578ade3707 Mon Sep 17 00:00:00 2001 From: Egbert Teeselink <703546+eteeselink@users.noreply.github.com> Date: Wed, 11 Oct 2017 10:21:10 +0200 Subject: [PATCH 1/3] Add "Windows support" to README Added a section that explains how to get the `transfer` alias on Windows. --- README.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/README.md b/README.md index a3d0e91..1b8fc04 100644 --- a/README.md +++ b/README.md @@ -34,6 +34,19 @@ alias transfer=transfer $ transfer test.txt ``` +### On Windows + +Download [curl](https://curl.haxx.se/download.html). Then, put a file called transfer.cmd somewhere in your PATH with this inside it: +``` +@echo off +setlocal +:: write to output to tmpfile because of progress bar +set tmpfile=%TEMP%\~%~nx1.transfer +curl --progress-bar --upload-file %1 https://transfer.sh/%~nx1 >> %tmpfile% +type %tmpfile% +del %tmpfile% +``` + ## Usage Parameter | Description | Value | Env From 2e3d5594a4971e512e49fd9e6cddde7b82804035 Mon Sep 17 00:00:00 2001 From: Egbert Teeselink Date: Mon, 18 Jun 2018 08:36:44 +0200 Subject: [PATCH 2/3] Improve Windows support in README following CR --- README.md | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 1b8fc04..51f35c5 100644 --- a/README.md +++ b/README.md @@ -40,11 +40,10 @@ Download [curl](https://curl.haxx.se/download.html). Then, put a file called tra ``` @echo off setlocal -:: write to output to tmpfile because of progress bar -set tmpfile=%TEMP%\~%~nx1.transfer -curl --progress-bar --upload-file %1 https://transfer.sh/%~nx1 >> %tmpfile% -type %tmpfile% -del %tmpfile% +:: use env vars to pass names to PS, to avoid escaping issues +set FN=%~nx1 +set FULL=%1 +powershell -noprofile -command "$(Invoke-Webrequest -Method put -Infile $Env:FULL https://transfer.sh/$Env:FN).Content" ``` ## Usage From 44782a7519e23496011ff30d3d859a4f2870f265 Mon Sep 17 00:00:00 2001 From: Egbert Teeselink Date: Mon, 18 Jun 2018 08:40:09 +0200 Subject: [PATCH 3/3] Windows support in README: clean up --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 51f35c5..724cbcc 100644 --- a/README.md +++ b/README.md @@ -36,7 +36,7 @@ $ transfer test.txt ### On Windows -Download [curl](https://curl.haxx.se/download.html). Then, put a file called transfer.cmd somewhere in your PATH with this inside it: +Put a file called transfer.cmd somewhere in your PATH with this inside it: ``` @echo off setlocal