Skip to content
Merged
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
25 changes: 4 additions & 21 deletions scripts/set-icon.ps1
Original file line number Diff line number Diff line change
@@ -1,33 +1,16 @@
# Applies one of the candidate icons in src-tauri/icon-variants/ and regenerates every size.
# Regenerates every icon size from src-tauri/app-icon.svg.
#
# Usage: scripts/set-icon.ps1 check
# scripts/set-icon.ps1 # lists what there is
# Usage: scripts/set-icon.ps1
#
# `tauri icon` also writes Android and iOS assets. This app is Windows only, so they are removed
# again rather than left to be committed.

param([string]$Name)

$ErrorActionPreference = 'Stop'

$root = Split-Path -Parent $PSScriptRoot
$variants = Join-Path $root 'src-tauri\icon-variants'
$target = Join-Path $root 'src-tauri\app-icon.svg'

$available = Get-ChildItem $variants -Filter *.svg | ForEach-Object { $_.BaseName }

if (-not $Name) {
Write-Host "Candidates in src-tauri/icon-variants:"
$available | ForEach-Object { Write-Host " $_" }
exit 0
}

if ($available -notcontains $Name) {
throw "no candidate named '$Name'. Available: $($available -join ', ')"
}
$source = Join-Path $root 'src-tauri\app-icon.svg'

Copy-Item (Join-Path $variants "$Name.svg") $target -Force
Write-Host "app-icon.svg <- $Name.svg"
if (-not (Test-Path $source)) { throw "no source icon at $source" }

Push-Location $root
try {
Expand Down
41 changes: 6 additions & 35 deletions src-tauri/app-icon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
35 changes: 0 additions & 35 deletions src-tauri/icon-variants/check-outline.svg

This file was deleted.

35 changes: 0 additions & 35 deletions src-tauri/icon-variants/check.svg

This file was deleted.

33 changes: 0 additions & 33 deletions src-tauri/icon-variants/plain-seal.svg

This file was deleted.

32 changes: 0 additions & 32 deletions src-tauri/icon-variants/plain.svg

This file was deleted.

34 changes: 0 additions & 34 deletions src-tauri/icon-variants/star-outline.svg

This file was deleted.

34 changes: 0 additions & 34 deletions src-tauri/icon-variants/star.svg

This file was deleted.

30 changes: 0 additions & 30 deletions src-tauri/icon-variants/tux-at-foot.svg

This file was deleted.

33 changes: 0 additions & 33 deletions src-tauri/icon-variants/tux-band-roll.svg

This file was deleted.

31 changes: 0 additions & 31 deletions src-tauri/icon-variants/tux-belly-badge.svg

This file was deleted.

Loading
Loading