Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,21 @@ TLS.

# Installation

## Build from Source
```
cargo install sendme
```

## For Linux/MacOS/Windows (bash)
```
curl -fsSL https://iroh.computer/sendme.sh | sh
```

## For Windows (Run in Powershell)
```
iwr https://iroh.computer/sendme.ps1 -useb | iex
```

# Usage

## Send side
Expand Down
34 changes: 34 additions & 0 deletions install-sendme.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
$release_url = "https://api.github.com/repos/n0-computer/sendme/releases/latest"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And can we drop this as the script now lives in the iroh.computer repo.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would change the release_url to
$release_url = "https://api.github.com/repos/n0-computer/iroh.computer/releases/latest" but iroh.computer repo doesnt have any releases and this script lies in that repo where it re-directs to the sendme repo.
Could you clarify what changes you're expecting me to make in this context?


$target = "windows-x86_64"
$zipFile = "sendme.zip"
$extractPath = ".\sendme"

Write-Host "Fetching latest release for $target..."
$releaseJson = Invoke-RestMethod -Uri $release_url
$releaseUrl = ($releaseJson.assets | Where-Object { $_.browser_download_url -match $target }).browser_download_url

if (-not $releaseUrl) {
Write-Host "Error: No release found for $target" -ForegroundColor Red
exit 1
}

Write-Host "Downloading from $releaseUrl..."
Invoke-WebRequest -Uri $releaseUrl -OutFile $zipFile

Write-Host "Extracting..."
Expand-Archive -Path $zipFile -DestinationPath $extractPath -Force

Write-Host "Cleaning up..."
Remove-Item -Force $zipFile

Write-Host "Installation complete!"

# Add the 'sendme' folder to PATH
$sendmePath = (Resolve-Path $extractPath).Path

# Add the folder to the PATH permanently (user level)
$env:Path += ";$sendmePath"
[System.Environment]::SetEnvironmentVariable("Path", $env:Path, [System.EnvironmentVariableTarget]::User)

Write-Host "'$sendmePath' has been permanently added to user PATH." -ForegroundColor Green