setup.ps1 996 B

123456789101112131415161718192021222324252627282930
  1. #!/usr/bin/env pwsh
  2. echo "Building API definitions..."
  3. cd api
  4. yarn; yarn build
  5. cd ..
  6. echo "Building the Tauri CLI..."
  7. cd cli\core
  8. cargo build --release
  9. cd ..\..
  10. Set-Alias rtauri "$(pwd)\cli\core\target\release\cargo-tauri.exe"
  11. echo "Added alias 'rtauri' for '$(pwd)\cli\core\target\release\cargo-tauri.exe'"
  12. echo "Tauri CLI installed. Run it with '$ rtauri tauri [COMMAND]'."
  13. $yes = New-Object System.Management.Automation.Host.ChoiceDescription "&Yes"
  14. $no = New-Object System.Management.Automation.Host.ChoiceDescription "&No"
  15. $options = [System.Management.Automation.Host.ChoiceDescription[]]($yes, $no)
  16. $result = $host.ui.PromptForChoice("Node.js CLI", "Do you want to use the Node.js CLI?", $options, 1)
  17. switch ($result) {
  18. 0{
  19. cd cli\tauri.js
  20. yarn; yarn build
  21. cd ..\..
  22. Set-Alias stauri "$(pwd)\cli\tauri.js\bin\tauri.js"
  23. echo "Added alias 'stauri' for '$(pwd)\cli\tauri.js\bin\tauri.js'"
  24. echo "Tauri Node.js CLI installed. Run it with '$ stauri [COMMAND]'"
  25. }
  26. }