-
Notifications
You must be signed in to change notification settings - Fork 0
/
windows.ps1
35 lines (28 loc) · 998 Bytes
/
windows.ps1
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
# Absolute path to your storage directory
$REPO_DIR = "C:\path\to\repo_storage\dir"
$REPO_NAME = "repo"
$DIST_DIR = "C:\path\to\dist"
# Navigate to the storage directory
Set-Location $REPO_DIR
# Clone the private repository
if (!(git clone [email protected]:username/$REPO_NAME.git)) {
Write-Output "Git clone failed!"
exit 1
}
# Navigate to the cloned repository directory
Set-Location "$REPO_DIR\$REPO_NAME"
# Use the cargo package manager to compile the project with optimizations
if (!(cargo build --release)) {
Write-Output "Cargo build failed!"
exit 1
}
# Use trunk package manager to build the project with optimizations
if ! trunk build --release; then
echo "Trunk build failed!"
exit 1
fi
# Navigate to the dist directory
Set-Location $DIST_DIR
# Get the filename, extract the unique identifier, and copy it to the clipboard
(Get-ChildItem -Filter "projectname*.wasm" |
ForEach-Object { $_.BaseName -replace '^projectname-', '' -replace '_bg$', '' }) | Set-Clipboard