Skip to content

Commit

Permalink
Merge pull request #71 from voxpupuli/create_cache
Browse files Browse the repository at this point in the history
Fix #70 - cache dir does not exist
  • Loading branch information
bastelfreak authored Apr 22, 2022
2 parents 91d0c87 + ca7ba82 commit 4ba308b
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/ra10ke/solve.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
require 'solve'
require 'yaml/store'
require 'semverse/version'
require 'fileutils'

# How many versions to fetch from the Forge, at most
FETCH_LIMIT = 3
Expand Down Expand Up @@ -35,6 +36,9 @@ def define_task_solve_dependencies(*_args)
end
# Actual new logic begins here:
cache = (ENV['XDG_CACHE_DIR'] || File.expand_path('~/.cache'))

FileUtils.mkdir_p(cache)

# Metadata cache, since the Forge is slow:
@metadata_cache = YAML::Store.new File.join(cache, 'ra10ke.metadata_cache')
# The graph of available module versions
Expand Down

0 comments on commit 4ba308b

Please sign in to comment.