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
29427c56
Commit
29427c56
authored
Sep 13, 2013
by
zeke
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
restore cache only if package.json and node version are unchanged
parent
01580e32
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
6 deletions
+10
-6
compile
bin/compile
+10
-6
No files found.
bin/compile
View file @
29427c56
...
...
@@ -60,15 +60,19 @@ else
fi
fi
# Run subsequent node/npm commands from the build path
cd
$build_dir
# Configure cache directories
cache_store_dir
=
"
$cache_dir
/node_modules/
$node_version
"
package_checksum
=
$(
cat
$build_dir
/package.json |
md5sum
|
awk
'{print $1}'
)
cache_store_dir
=
"
$cache_dir
/node_modules/
$node_version
/
$package_checksum
"
cache_target_dir
=
"
$build_dir
/node_modules"
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; r
estoring node_modules from cache"
# Restore node_modules from cache if resolved node version and
# package.json match the previous build
if
test
-d
$cache_store_dir
;
then
status
"package.json and node version unchanged since last build"
status
"
R
estoring node_modules from cache"
if
test
-d
$cache_target_dir
;
then
cp
-r
$cache_store_dir
/
*
$cache_target_dir
/
else
...
...
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