ソースを参照

update: use debian distro detect

Mark24 2 年 前
コミット
3783f4839b
2 ファイル変更7 行追加4 行削除
  1. 3 2
      installer.rb
  2. 4 2
      lib/config.rb

+ 3 - 2
installer.rb

@@ -5,11 +5,12 @@ require "./lib/config"
 
 module OSPatch
   def check_linux_debian_distro
-    debian_distro = %w[debian ubuntu linuxmint linux-mint]
     os_release_file = "/etc/os-release"
     if File.exist?(os_release_file)
       os_release = File.read(os_release_file)
-      debian_distro.each { |distro| return true if os_release.include?(distro) }
+      OSDetect::DebianDistro.each do |distro|
+        return true if os_release.include?(distro)
+      end
     end
     return false
   end

+ 4 - 2
lib/config.rb

@@ -1,8 +1,10 @@
 module RimeDeploy
+  module OSDetect
+    DebianDistro = %w[debian ubuntu linuxmint linux-mint]
+  end
   module Config
     RIME_CONFIG_REPO = "https://github.com/iDvel/rime-ice.git"
-
-    class Mac
+    class MacOS
       InstallCmd = "brew install --cask squirrel"
       ConfigPath = "~/Library/Rime"
     end