Skip to content

Commit

Permalink
Merge pull request #565 from OSC/node-cache
Browse files Browse the repository at this point in the history
node apps use their own cache directory
  • Loading branch information
johrstrom authored Jul 6, 2020
2 parents 0b71131 + c29c07e commit 7c2703d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion apps/files/bin/setup
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ include FileUtils

# path to your application root.
APP_ROOT = Pathname.new File.expand_path("../../", __FILE__)
CACHE = "#{ENV['HOME']}/.cache/yarn/ood-files-app"

chdir APP_ROOT do
# This script is a starting point to setup your application.
Expand All @@ -28,7 +29,7 @@ chdir APP_ROOT do
puts "\n== Installing dependencies =="
rm_rf "node_modules"
sh "npm install --production --prefix tmp yarn"
sh "tmp/node_modules/yarn/bin/yarn --production install"
sh "tmp/node_modules/yarn/bin/yarn --production install --cache-folder #{CACHE}"

puts "\n== Restarting application server =="
touch "tmp/restart.txt"
Expand Down
3 changes: 2 additions & 1 deletion apps/shell/bin/setup
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ include FileUtils

# path to your application root.
APP_ROOT = Pathname.new File.expand_path("../../", __FILE__)
CACHE = "#{ENV['HOME']}/.cache/yarn/ood-shell-app"

chdir APP_ROOT do
# This script is a starting point to setup your application.
Expand All @@ -16,7 +17,7 @@ chdir APP_ROOT do
puts "\n== Installing dependencies =="
rm_rf "node_modules"
sh "npm install --production --prefix tmp yarn"
sh "tmp/node_modules/yarn/bin/yarn --production install --flat"
sh "tmp/node_modules/yarn/bin/yarn --production install --flat --cache-folder #{CACHE}"

puts "\n== Restarting application server =="
touch "tmp/restart.txt"
Expand Down

0 comments on commit 7c2703d

Please sign in to comment.