Skip to content
This repository has been archived by the owner on Oct 26, 2018. It is now read-only.

Commit

Permalink
fix download manifest
Browse files Browse the repository at this point in the history
  • Loading branch information
ddollar committed May 30, 2012
1 parent 3702a2f commit 8a70b18
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 13 deletions.
10 changes: 5 additions & 5 deletions bin/compile
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ mkdir -p $cache_dir

# fetching app
echo -n "Recreating app from manifest... "
# manifest=$(mktemp -t manifest_XXXXX)
# curl -s $ANVIL_HOST/manifest/$id.json -o $manifest
# bin/download_manifest $manifest $compile_dir >/dev/null
cd $compile_dir
curl -s $MANIFEST_TGZ -o- | tar xzf -
manifest=$(mktemp -t manifest_XXXXX)
curl -s $ANVIL_HOST/manifest/$id.json -o $manifest
bin/download_manifest $manifest $compile_dir >/dev/null
# cd $compile_dir
# curl -s $MANIFEST_TGZ -o- | tar xzf -
echo "done"

# fetch buildpack
Expand Down
16 changes: 8 additions & 8 deletions lib/download_manifest.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,14 @@ datastore_fetchers = (manifest, dir) ->
fetchers[file_manifest.hash] = (async_cb) =>
filename = "#{dir}/#{name}"
mkdirp path.dirname(filename), =>
fs.open filename, "w", (err, fd) =>
options = url.parse("#{process.env.ANVIL_HOST}/file/#{file_manifest["hash"]}")
client = if options.protocol is "https:" then https else http
client.get options, (get) ->
get.on "data", (chunk) -> fs.write fd, chunk
get.on "end", ->
fs.fchmod fd, file_manifest.mode
fs.close fd
file = fs.createWriteStream filename
options = url.parse("#{process.env.ANVIL_HOST}/file/#{file_manifest["hash"]}")
client = if options.protocol is "https:" then https else http
client.get options, (get) ->
get.on "data", (chunk) -> file.write chunk
get.on "end", ->
file.end()
fs.chmod filename, file_manifest.mode, (err) ->
async_cb null, true

module.exports.execute = (args) ->
Expand Down

0 comments on commit 8a70b18

Please sign in to comment.