lib/u3d/commands.rb in u3d-1.0.1 vs lib/u3d/commands.rb in u3d-1.0.2
- old
+ new
@@ -96,19 +96,25 @@
inif.keys.each { |pack| UI.message " - #{pack}" }
end
end
end
+ def cache_versions(os, offline: false)
+ cache = Cache.new(force_os: os, offline: offline)
+ cache_os = cache[os.id2name] || {}
+ cache_versions = cache_os['versions'] || {}
+ cache_versions
+ end
+
def install(args: [], options: {})
version = specified_or_current_project_version(args[0])
os = U3dCore::Helper.operating_system
packages = packages_with_unity_first(os, options)
- cache = Cache.new(force_os: os)
- cache_versions = cache[os.id2name]['versions']
+ cache_versions = cache_versions(os, offline: !options[:download])
version = interpret_latest(version, cache_versions)
unless cache_versions[version]
UI.error "No version '#{version}' was found in cache. Either it doesn't exist or u3d doesn't know about it yet. Try refreshing with 'u3d available -f'"
return
end
@@ -125,9 +131,18 @@
files = Downloader.fetch_modules(definition, packages: packages, download: options[:download])
return unless options[:install]
Installer.install_modules(files, definition.version, installation_path: options[:installation_path])
+ end
+
+ def install_dependencies
+ unless Helper.linux?
+ UI.important 'u3d dependencies is Linux-only, and not needed on other OS'
+ return
+ end
+
+ LinuxDependencies.install
end
def run(options: {}, run_args: [])
version = options[:unity_version]