-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathrun.ps1
More file actions
64 lines (52 loc) · 1.89 KB
/
run.ps1
File metadata and controls
64 lines (52 loc) · 1.89 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
# Copyright (c) 2026 MikeRust contributors. Licensed under AGPL-3.0-only.
#requires -Version 5.1
<#
.SYNOPSIS
Launch MikeRust in debug mode from the repo root.
.DESCRIPTION
Thin convenience wrapper around `scripts/dev.ps1`. Defaults to
verbose backend tracing (`-LogTrace` = RUST_LOG=mike=debug,info) so
the dev window shows the same level of detail you'd expect from a
"debug build" — without having to remember the flag.
The actual launch logic — local tauri CLI resolution, Tauri config
selection, Vite startup via `beforeDevCommand` — lives in
`scripts/dev.ps1`. Edit that file, not this one, when you need to
change the dev story.
.PARAMETER Quiet
Skip the verbose RUST_LOG and run with whatever level is already in
the environment (or unset). Useful when you want a clean log output.
.PARAMETER RustLog
Override the RUST_LOG value (only relevant without -Quiet). Default:
`mike=debug,info`. Examples: `mike=trace,info`, `info,mike=debug,
hyper=warn`.
.EXAMPLE
./run.ps1
Launch dev mode with verbose backend trace.
.EXAMPLE
./run.ps1 -Quiet
Launch dev mode without setting RUST_LOG.
.EXAMPLE
./run.ps1 -RustLog 'mike=trace,info,hyper=warn'
Launch dev mode with a custom trace level.
#>
[CmdletBinding()]
param(
[switch]$Quiet,
[string]$RustLog = 'mike=debug,info'
)
$ErrorActionPreference = 'Stop'
$RepoRoot = $PSScriptRoot
Set-Location $RepoRoot
$dev = Join-Path $RepoRoot 'scripts\dev.ps1'
if (-not (Test-Path $dev)) {
throw "scripts/dev.ps1 not found at $dev. Has the repo layout changed?"
}
if (-not $Quiet) {
$env:RUST_LOG = $RustLog
Write-Host "RUST_LOG=$RustLog (debug mode)" -ForegroundColor DarkGray
# scripts/dev.ps1 -LogTrace would overwrite RUST_LOG with its own
# default, so we set the env var here and call dev.ps1 without the
# flag — RUST_LOG is already exported into the child process.
}
& $dev
exit $LASTEXITCODE