Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
H
heroku-buildpack-nodejs
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
JIRA
JIRA
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Python-Dev
heroku-buildpack-nodejs
Commits
437e2b1e
Commit
437e2b1e
authored
Sep 13, 2013
by
zeke
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
restore node_modules from cache if package.json unchanged
parent
e5163904
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
11 deletions
+11
-11
compile
bin/compile
+11
-11
No files found.
bin/compile
View file @
437e2b1e
...
...
@@ -64,24 +64,24 @@ fi
cache_store_dir
=
"
$cache_dir
/node_modules/
$node_version
"
cache_target_dir
=
"
$build_dir
/node_modules"
# Restore node_modules from cache, if present
if
test
-d
$cache_store_dir
;
then
status
"Restoring node_modules cache"
cd
$build_dir
# Restore node_modules from cache if package.json unchanged.
if
test
-d
$cache_store_dir
&&
diff
$cache_store_dir
/package.json
$build_dir
/package.json
>
/dev/null
;
then
status
"package.json unchanged; restoring node_modules from cache"
if
test
-d
$cache_target_dir
;
then
cp
-r
$cache_store_dir
/
*
$cache_target_dir
/
else
cp
-r
$cache_store_dir
$cache_target_dir
fi
status
"Pruning any unused dependencies"
npm prune | indent
else
# Install dependencies anew
status
"Installing dependencies"
npm
install
--production
| indent
status
"Rebuilding dependencies"
npm rebuild | indent
fi
# Install dependencies
status
"Installing dependencies"
cd
$build_dir
npm
install
--production
| indent
npm rebuild | indent
# Cache node_modules for future builds
if
test
-d
$cache_target_dir
;
then
status
"Caching node_modules for future builds"
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment