Method: MGit::Config#update_mgit_config
- Defined in:
- lib/m-git/command/config.rb
#update_mgit_config(config_path) ⇒ Object
更新配置表软链接
102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 |
# File 'lib/m-git/command/config.rb', line 102 def update_mgit_config(config_path) config = Manifest.parse(Utils.(config_path)) Utils.execute_under_dir("#{File.join(Workspace.root, Constants::PROJECT_DIR[:source_config])}") { mgit_managed_config_link_path = File.join(Dir.pwd, Constants::CONFIG_FILE_NAME[:manifest]) mgit_managed_config_cache_path = File.join(Dir.pwd, Constants::CONFIG_FILE_NAME[:manifest_cache]) # 在.mgit/source-config文件夹下创建原始配置文件的软连接 if config.path != mgit_managed_config_link_path Utils.link(config.path, mgit_managed_config_link_path) end # 将配置缓存移动到.mgit/source-config文件夹下 if config.cache_path != mgit_managed_config_cache_path FileUtils.rm_f(mgit_managed_config_cache_path) if File.exist?(mgit_managed_config_cache_path) FileUtils.mv(config.cache_path, Dir.pwd) end Output.("配置文件更新完毕!") } end |