Commit 47ae57b5 authored by Aral Balkan's avatar Aral Balkan

Update Cache to work on different path structure of production

parent ec790276
Pipeline #682 failed with stages
......@@ -11,6 +11,8 @@ Promise = require 'thrush'
glob = require 'glob'
globAsync = Promise.promisify glob
app = require './App'
class Cache
homeDirectory: null
......@@ -77,7 +79,11 @@ class Cache
.series (file) =>
fileComponents = file.split '/'
filePathFragment = fileComponents[5..].join '/'
# On production the route to the data folders has one fewer level.
# Take that into account when creating the cache.
indexToStartFrom = if app.isRunningInProduction then 4 else 5
filePathFragment = fileComponents[indexToStartFrom..].join '/'
# Using the sync version of stat is a little faster here
stats = fs.statSync file
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment