gitsubmoduleforeach--recursive'git checkout main || true'
Create venv and install dependencies
1
uvsync--all-packages
Start using any Project
123
uvrunshaderflow
uvrundepthflow
uvrunbroken
Activate the venv
1234567
# Windows:
.venv\Scripts\Activate.ps1# PowerShell
.venv\Scripts\Activate.bat# CMD# Linux and MacOS:source.venv/bin/activate# Bashsource.venv/bin/activate.fish# Fish
#!/usr/bin/env pwsh# (c) MIT License, Tremeschin# Script version: 2024.11.10# This function reloads the "PATH" environment variable so that we can# find newly installed applications on the same script executionfunctionReload-Path{$wingetPath=$env:LocalAppData+"\Microsoft\WindowsApps"$machinePath=[System.Environment]::GetEnvironmentVariable("Path","Machine")$userPath=[System.Environment]::GetEnvironmentVariable("Path","User")$env:Path=$machinePath+";"+$userPath+";"+$wingetPath}# Option to continue normally even on errorsfunctionAsk-Continue{echo "`nPress Enter to continue normally, or Ctrl+C to exit"Read-Host}# Consistency in showing stepsfunctionPrint-Step{echo "`n:: $args`n"}# This function immediately exits if Winget is found, else it tries to install it with# the official Microsoft docs 'Add-AppxPackage' method. If it still fails, it tries# to download the Appx package (.msibundle) and install it manually.functionHave-Winget{Reload-Pathif((Get-Commandwinget-ErrorActionSilentlyContinue)){return}Print-Step"Installing Winget"# Attempt via: https://learn.microsoft.com/en-us/windows/package-manager/winget/Add-AppxPackage-RegisterByFamilyName-MainPackageMicrosoft.DesktopAppInstaller_8wekyb3d8bbweReload-Path# Attempt manual method if still not foundif(-not(Get-Commandwinget-ErrorActionSilentlyContinue)){echo "Winget installation with Add-AppxPackage failed, trying 'manual' method.."Print-Step"Downloading Winget installer, might take a while.."# Why tf does disabling progress bar yields 50x faster downloads????? https://stackoverflow.com/a/43477248$msi="https://github.com/microsoft/winget-cli/releases/download/v1.7.10582/Microsoft.DesktopAppInstaller_8wekyb3d8bbwe.msixbundle"$tempFile=[System.IO.Path]::GetTempPath()+"\winget.msixbundle"$ProgressPreference='SilentlyContinue'Invoke-WebRequest-Uri$msi-OutFile$tempFile# Install the Appx packageecho "Finished download, now installing it, can take a while on HDDs systems.."Add-AppxPackage-Path$tempFileReload-Path}# If Winget is still not available, exitif(-not(Get-Commandwinget-ErrorActionSilentlyContinue)){Print-Step"Winget was not found, and installation failed with Add-AppxPackage"echo "Winget was installed but still not found. Probably a Path issue or installation failure"echo "> Please get it at https://learn.microsoft.com/en-us/windows/package-manager/winget"echo "> Alternatively, install manually what was meant to be installed but failed"Ask-Continue}}if(-not(Get-Commandgit-ErrorActionSilentlyContinue)){Print-Step"Git was not found, installing with Winget"Have-Wingetwingetinstall-e--idGit.GitReload-Pathif(-not(Get-Commandgit-ErrorActionSilentlyContinue)){Print-Step"Git was not found, and installation failed with Winget"echo "Git was installed but still not found. Probably a Path issue or installation failure"echo "> Please get it at https://git-scm.com"Ask-Continue}else{echo "Git was installed successfully"}}else{Print-Step"Updating Git"wingetupgrade--idGit.Git}if(-not(Get-Commanduv-ErrorActionSilentlyContinue)){Print-Step"uv was not found, installing with Winget"Have-Wingetwingetinstall-e--id=astral-sh.uvReload-Pathif(-not(Get-Commanduv-ErrorActionSilentlyContinue)){Print-Step"uv was not found, and installation failed with Winget"echo "uv was installed but still not found. Probably a Path issue or installation failure"echo "> Please get it at https://docs.astral.sh/uv/"Ask-Continue}else{echo "uv was installed successfully"}}else{Print-Step"Updating uv"wingetupgrade--idastral-sh.uv}# # Clone the Repositories, Install Python Dependencies on venv and Spawn a new Shell# Skip cloning if already on a cloned directoryif(-not(Test-Path-Path"Broken")){Print-Step"Cloning BrokenSource Repository and all Submodules"gitclonehttps://github.com/BrokenSource/BrokenSource--recurse-submodules--jobs4cd BrokenSourcePrint-Step"Checking out main branch for all submodules"gitsubmoduleforeach--recursive'git checkout main || true'}else{Print-Step"Already in a Cloned Directory, Skipping Cloning"}# The PowerShell execution policy must allow for the Python activation script to runif((Get-ExecutionPolicy)-notin@("Unrestricted","RemoteSigned","Bypass")){echo "`n(Warning) The current PowerShell ExecutionPolicy disallows activating the Python venv"echo "> More info: https://github.com/microsoft/vscode-python/issues/2559"echo "> Need any of: 'Unrestricted', 'RemoteSigned', or 'Bypass'"echo "> Current ExecutionPolicy: '$(Get-ExecutionPolicy)'"echo "`nDon't worry, we just need to run as admin the following:"echo "> 'Set-ExecutionPolicy RemoteSigned'`n"Read-Host"Press Enter to do it, or Ctrl+C to exit"Start-Processpowershell-VerbRunAs-ArgumentList"-Command Set-ExecutionPolicy RemoteSigned"}Print-Step"Creating Virtual Environment and Installing Dependencies"uvsync--all-packagesPrint-Step"Spawning a new Shell in the Virtual Environment"powershell-ExecutionPolicyBypass-NoLogo-NoExit-File.\.venv\Scripts\Activate.ps1
#!/bin/bash# (c) MIT License, Tremeschin# Script version: 2024.11.10{# Prevent execution if partially downloaded# Exit on any error or failed command (includes pipes)set -euopipefail# Detect current systemMACOS=false[["$OSTYPE"=="darwin"*]]&&MACOS=true# macOS: Must have 'Xcode Command Line Tools' installedif$MACOS;thenif[!xcode-select-p&>/dev/null];thenprintf"(Error) Xcode Command Line Tools are not installed\n"printf"• Install them with 'xcode-select --install'\n"printf"• Run again this script after installation\n"exit1fifi# Must have 'git' installedgit=""if[-x"$(command-vgit)"];thengit=$(readlink-f$(whichgit))printf"\n• Found Git at ($git)\n"elseprintf"\n(Error) Git wasn't found, and is required to clone the repositories\n"printf"• Get it at (https://git-scm.com/), or from your distro:\n"printf"• macOS: 'brew install git' - needs (https://brew.sh/)\n"printf"• Ubuntu: 'sudo apt update && sudo apt install git'\n"printf"• Arch: 'sudo pacman -Syu git'\n"printf"• Fedora: 'sudo dnf install git'\n"exit1fi# Must have 'uv' installeduv=""forattemptin$(seq12);doif[-x"$(command-vuv)"];thenuv=$(readlink-f$(whichuv))printf"\n• Found uv at ($uv)\n"breakfiif[$attempt-eq2];thenprintf"\n(Error) uv wasn't found after an installation attempt\n"printf"• Do you have the Shims directory on PATH?\n"printf"• Try restarting the Shell and retrying\n"printf"• Get it at (https://docs.astral.sh/uv/)\n"exit1fiprintf"\n• uv wasn't found, will attempt to install it\n\n"/bin/bash-c"$(curl -sSfLhttps://astral.sh/uv/install.sh)"done# # Clone the Repositories, Install Python Dependencies on venv and Spawn a new Shell# Already inside a git repositoryifgitrev-parse--is-inside-work-tree&>/dev/null;thenwork_tree=$(gitrev-parse--show-toplevel)# Must be on BrokenSource to continueif(cd "$work_tree"&&gitremoteget-urlorigin2>/dev/null|grep-q"BrokenSource");thenprintf"\n• Already inside the BrokenSource main repository\n"printf" - For latest changes, run 'Scripts/update.sh'\n"cd "$work_tree"elseprintf"\n(Error) Currently in a non-BrokenSource main git epository, exiting\n"exit1fi# Directory existselif[-d"BrokenSource"];thenprintf"\n• BrokenSource directory exists. Assuming it's the repository\n"printf" - On errors, try deleting the directory and run again\n"printf" - For latest changes, run 'Scripts/update.sh'\n"cd BrokenSource# Fresh cloneelseprintf"\n• Cloning BrokenSource Repository and all Submodules\n\n"$gitclonehttps://github.com/BrokenSource/BrokenSource/--recurse-submodules--jobs4cd BrokenSourceprintf"\n• Checking out main branch for all submodules\n\n"$gitsubmoduleforeach--recursive'git checkout main || true'fi# Make scripts executable for later usechmod+xWebsite/get.shchmod+x./Scripts/activate.shprintf"\n• Creating Virtual Environment and Installing Dependencies\n\n"$uvselfupdate||printf"\n• uv self update failed, ignoring..\n\n"$uvsync--all-packages||printf"\n• uv sync failed, could cause issues..\n\n"printf"\n• Spawning a new Shell in the Virtual Environment\n"printf" - Source the Virtual Environment to get here again\n"printf" - Tip: Alternative, run 'Scripts/activate.sh'\n\n"source.venv/bin/activateexec$SHELL}