NullVoider commited on
Commit
cded57d
Β·
verified Β·
1 Parent(s): b319b56

Delete scripts/setup-win11.ps1 with huggingface_hub

Browse files
Files changed (1) hide show
  1. scripts/setup-win11.ps1 +0 -83
scripts/setup-win11.ps1 DELETED
@@ -1,83 +0,0 @@
1
- # =============================================================================
2
- # setup-win11.ps1
3
- # One-command clone + automatic download of win11.qcow2 into win11-image/
4
- # =============================================================================
5
-
6
- $ErrorActionPreference = 'Stop' # Exit immediately if any command fails
7
-
8
- $GithubRepo = "https://github.com/nullvoider07/windows11-base"
9
- $RepoName = Split-Path $GithubRepo -Leaf
10
-
11
- Write-Host "πŸš€ Cloning GitHub repo: $GithubRepo"
12
-
13
- # ----------------------------- Clone with GitHub CLI -----------------------
14
- Write-Host "πŸ”§ Checking GitHub CLI..."
15
-
16
- if (-not (Get-Command gh -ErrorAction SilentlyContinue)) {
17
- Write-Host " GitHub CLI not found. Installing via winget..."
18
-
19
- # Install gh silently, accepting agreements automatically
20
- winget install --id GitHub.cli --exact --accept-source-agreements --accept-package-agreements
21
-
22
- # Refresh the PATH variables in the current session so 'gh' is recognized immediately
23
- $env:Path = [System.Environment]::GetEnvironmentVariable("Path", "Machine") + ";" + [System.Environment]::GetEnvironmentVariable("Path", "User")
24
-
25
- # Verify installation succeeded
26
- if (-not (Get-Command gh -ErrorAction SilentlyContinue)) {
27
- throw "❌ Failed to install GitHub CLI automatically. Please install it manually from https://cli.github.com"
28
- }
29
- Write-Host " βœ… GitHub CLI installed successfully."
30
- } else {
31
- Write-Host " βœ… GitHub CLI already available."
32
- }
33
-
34
- gh repo clone $GithubRepo $RepoName -- --depth=1
35
-
36
- # ----------------------------- Create folder -------------------------------
37
- Write-Host "πŸ“ Creating folder: win11-image/"
38
- $ImagePath = Join-Path $RepoName "win11-image"
39
- New-Item -ItemType Directory -Force -Path $ImagePath | Out-Null
40
-
41
- # ----------------------------- Ensure uv is available ---------------------
42
- Write-Host "πŸ”§ Checking uv..."
43
-
44
- if (Get-Command uv -ErrorAction SilentlyContinue) {
45
- Write-Host " uv already available β€” skipping installation."
46
- } else {
47
- Write-Host " Installing uv package manager..."
48
- Invoke-RestMethod -Uri https://astral.sh/uv/install.ps1 | Invoke-Expression
49
- $env:Path += ";$HOME\.cargo\bin;$HOME\.local\bin"
50
- }
51
-
52
- # ----------------------------- Ephemeral venv for huggingface-cli ----------
53
- Write-Host "πŸ”§ Creating ephemeral venv for huggingface-cli..."
54
-
55
- $TempDir = [System.IO.Path]::GetTempPath()
56
- $HfVenv = Join-Path $TempDir "hf-venv-$(New-Guid)"
57
-
58
- # uv venv picks the correct current Python automatically
59
- uv venv $HfVenv --quiet
60
-
61
- # Install directly into the venv β€” no --system, no activation needed
62
- uv pip install --python "$HfVenv\Scripts\python.exe" transformers --quiet
63
-
64
- Write-Host " βœ… huggingface-hub installed in ephemeral venv."
65
-
66
- # ----------------------------- Download QCOW2 ------------------------------
67
- Write-Host "πŸ“₯ Downloading win11.qcow2 (large file) into $RepoName\win11-image\ ..."
68
- Write-Host " (This may take a while β€” progress bar will show)"
69
-
70
- # Call huggingface-cli directly by its venv path β€” no PATH lookup, no cache
71
- & "$HfVenv\Scripts\hf.exe" download NullVoider/windows11-base win11.qcow2 --local-dir $ImagePath
72
-
73
- # ----------------------------- Cleanup venv --------------------------------
74
- Write-Host "🧹 Cleaning up ephemeral venv..."
75
- Remove-Item -Recurse -Force $HfVenv
76
-
77
- # ----------------------------- Final message -------------------------------
78
- Write-Host ""
79
- Write-Host "βœ… SUCCESS!" -ForegroundColor Green
80
- Write-Host " Repository cloned β†’ $RepoName\"
81
- Write-Host " QCOW2 image ready at: $RepoName\win11-image\win11.qcow2"
82
- Write-Host ""
83
- Write-Host " Next time just run: cd $RepoName ; git pull"