| #!/bin/bash |
| |
| |
| |
| |
|
|
| set -e |
|
|
| GITHUB_REPO="https://github.com/nullvoider07/windows11-base" |
| REPO_NAME=$(basename "$GITHUB_REPO") |
|
|
| echo "π Cloning GitHub repo: $GITHUB_REPO" |
|
|
| |
| echo "π§ Checking GitHub CLI..." |
|
|
| if ! command -v gh >/dev/null 2>&1; then |
| echo " GitHub CLI not found. Attempting to install..." |
| |
| |
| if command -v brew >/dev/null 2>&1; then |
| brew install gh |
| |
| elif command -v apt-get >/dev/null 2>&1; then |
| curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg | sudo dd of=/usr/share/keyrings/githubcli-archive-keyring.gpg && \ |
| sudo chmod go+r /usr/share/keyrings/githubcli-archive-keyring.gpg && \ |
| echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | sudo tee /etc/apt/sources.list.d/github-cli.list > /dev/null && \ |
| sudo apt-get update && sudo apt-get install gh -y |
| else |
| echo "β Unsupported package manager. Please install GitHub CLI manually:" |
| echo " https://cli.github.com" |
| exit 1 |
| fi |
| else |
| echo " β
GitHub CLI already available." |
| fi |
|
|
| gh repo clone "$GITHUB_REPO" "$REPO_NAME" -- --depth=1 |
|
|
| |
| echo "π Creating folder: win11-image/" |
| mkdir -p "$REPO_NAME/win11-image" |
|
|
| |
| echo "π§ Checking uv..." |
|
|
| if command -v uv >/dev/null 2>&1; then |
| echo " uv already available β skipping installation." |
| else |
| echo " Installing uv package manager..." |
| curl -LsSf https://astral.sh/uv/install.sh | sh |
| export PATH="$HOME/.cargo/bin:$HOME/.local/bin:$PATH" |
| hash -r |
| fi |
|
|
| |
| |
| |
| |
| echo "π§ Creating ephemeral venv for huggingface-cli..." |
|
|
| HF_VENV="$(mktemp -d)/hf-venv" |
|
|
| |
| uv venv "$HF_VENV" --quiet |
|
|
| |
| uv pip install --python "$HF_VENV/bin/python" transformers --quiet |
|
|
| echo " β
huggingface-hub installed in ephemeral venv." |
|
|
| |
| echo "π₯ Downloading win11.qcow2 (large file) into $REPO_NAME/win11-image/ ..." |
| echo " (This may take a while β progress bar will show)" |
|
|
| |
| "$HF_VENV/bin/hf" download NullVoider/windows11-base win11.qcow2 \ |
| --local-dir "$REPO_NAME/win11-image" |
|
|
| |
| echo "π§Ή Cleaning up ephemeral venv..." |
| rm -rf "$HF_VENV" |
|
|
| |
| echo "" |
| echo "β
SUCCESS!" |
| echo " Repository cloned β $REPO_NAME/" |
| echo " QCOW2 image ready at: $REPO_NAME/win11-image/win11.qcow2" |
| echo "" |
| echo " Next time just run: cd $REPO_NAME && git pull" |