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
dce88707
Commit
dce88707
authored
Aug 10, 2013
by
zeke
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
use lowercase variable names
parent
214970a0
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
20 deletions
+20
-20
compile
bin/compile
+20
-20
No files found.
bin/compile
View file @
dce88707
#!/usr/bin/env bash
BUILD_DIR
=
$1
CACHE_DIR
=
$2
LP_DIR
=
$(
cd
$(
dirname
$0
)
;
cd
..
;
pwd
)
DEFAULT_VERSION
=
"0.10.15"
NODE_URL
=
"http://s3pository.heroku.com/node/v
$DEFAULT_VERSION
/node-v
$DEFAULT_VERSION
-linux-x64.tar.gz"
build_dir
=
$1
cache_dir
=
$2
lp_dir
=
$(
cd
$(
dirname
$0
)
;
cd
..
;
pwd
)
default_version
=
"0.10.15"
$node_url
=
"http://s3pository.heroku.com/node/v
$default_version
/node-v
$default_version
-linux-x64.tar.gz"
source
$
LP_DIR
/bin/common.sh
source
$
lp_dir
/bin/common.sh
# Output debug info on exit
trap
cat_npm_debug_log EXIT
status
"Downloading node v
$
DEFAULT_VERSION
"
tar_download
$
NODE_URL
$BUILD_DIR
status
"Downloading node v
$
default_version
"
tar_download
$
$
node_url
$build_dir
status
"Adding node and npm to
\$
PATH"
mv
$
BUILD_DIR
/node-v
$DEFAULT_VERSION
-linux-x64
$BUILD_DIR
/node
chmod
+x
$
BUILD_DIR
/node/bin/
*
PATH
=
$PATH
:
$
BUILD_DIR
/node/bin
mv
$
build_dir
/node-v
$default_version
-linux-x64
$build_dir
/node
chmod
+x
$
build_dir
/node/bin/
*
PATH
=
$PATH
:
$
build_dir
/node/bin
cd
$
BUILD_DIR
cd
$
build_dir
# Is a node version present in package.json?
# DESIRED_VERSION=$(cat $BUILD_DIR/package.json | node $LP_DIR
/vendor/json engines.node 2>/dev/null)
# echo "DESIRED_VERSION: $DESIRED_VERSION
"
# if [ "$DESIRED_VERSION
" != "" ]; then
# SATISFIED_VERSION=$(node $LP_DIR/vendor/semver/bin/semver $DEFAULT_VERSION -r "$DESIRED_VERSION
")
# echo "SATISFIED_VERSION: $SATISFIED_VERSION
"
#
fi
desired_version
=
$(
cat
$build_dir
/package.json | node
$lp_dir
/vendor/json engines.node 2>/dev/null
)
echo
"desired_version:
$desired_version
"
if
[
"
$desired_version
"
!=
""
]
;
then
default_satisfies
=
$(
node
$lp_dir
/vendor/semver/bin/semver
$default_version
-r
"
$desired_version
"
)
echo
"default_satisfies:
$default_satisfies
"
fi
status
"Installing dependencies with npm"
npm
install
--production
echo
"Dependencies installed"
| indent
status
"Building runtime environment"
mkdir
-p
$BUILD_DIR
/.profile.d
echo
"export PATH=
\"\$
HOME/node/bin:
$HOME
/bin:
\$
HOME/node_modules/.bin:
\$
PATH
\"
"
>
$BUILD_DIR
/.profile.d/nodejs.sh
\ No newline at end of file
mkdir
-p
$build_dir
/.profile.d
echo
"export PATH=
\"\$
HOME/node/bin:
$HOME
/bin:
\$
HOME/node_modules/.bin:
\$
PATH
\"
"
>
$build_dir
/.profile.d/nodejs.sh
\ No newline at end of file
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