deploy.rb 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. #!/usr/bin/env ruby
  2. puts "==== Rime auto deploy ===="
  3. puts "Have you installed Rime?(y/n)"
  4. result = gets
  5. if result.strip != "y"
  6. puts "(1/4) Install rime ? (y/n)"
  7. result = gets
  8. system("brew install --cask squirrel") if result.strip == "y"
  9. puts "step1: Logout and relogin system"
  10. puts "step2: Make Rime Input as your input method in system pane."
  11. puts "step3: Rerun this program, jump over install Rime step."
  12. else
  13. puts "Do you want to continue?(y/n)"
  14. result = gets
  15. exit 0 if result.strip != "y"
  16. puts "(2/4) Backup Rime default config."
  17. puts "run `mv ~/Library/Rime ~/Library/Rime.old`"
  18. system("mv ~/Library/Rime ~/Library/Rime.old")
  19. puts "done ✅"
  20. puts ""
  21. puts "(3/4) Install Rime-ice config."
  22. puts "run `git clone --depth=1 https://github.com/Mark24Code/rime-ice.git ~/Library/Rime`"
  23. system(
  24. "git clone --depth=1 https://github.com/Mark24Code/rime-ice.git ~/Library/Rime"
  25. )
  26. puts "done ✅"
  27. puts ""
  28. puts "(4/4) Download Custom config."
  29. system("cp ./default.custom.yaml ~/Library/Rime/")
  30. system("cp ./squirrel.custom.yaml ~/Library/Rime/")
  31. puts "done ✅"
  32. puts ""
  33. puts "Deploy finised"
  34. puts "Please open Rime setting pane and click `redeploy`. Enjoy~ 🍻"
  35. end