@@ -6,7 +6,10 @@ import * as tar from 'tar';
66const fetch = require ( "node-fetch" ) ;
77
88// TODO: add your deployment code here!
9- export async function run ( dir : string , options : Schema , logger : logging . LoggerApi ) {
9+ export async function run ( dir : string ,
10+ options : Schema ,
11+ outDir : string ,
12+ logger : logging . LoggerApi ) {
1013
1114 try {
1215
@@ -17,8 +20,8 @@ export async function run(dir: string, options: Schema, logger: logging.LoggerAp
1720
1821 const slugResult = await heroku . post ( `/apps/${ site . name } /slugs` , {
1922 body : {
20- process_types : { "web" : "node-v0.10.20-linux-x64/bin/node index.js" } ,
21- buildpack_provided_description : "heroku/nodejs"
23+ buildpack_provided_description : "heroku/nodejs" ,
24+ process_types : { "web" : `node-v0.10.20-linux-x64/bin/node index.js` }
2225 }
2326 }
2427 ) ;
@@ -27,22 +30,23 @@ export async function run(dir: string, options: Schema, logger: logging.LoggerAp
2730 // console.log(site);
2831 console . log ( slugResult ) ;
2932
33+ console . log ( `${ outDir } outdir` ) ;
3034 const tarResponse = await tar . c (
3135 {
3236 gzip : true ,
33- file : ` ${ dir } .tgz`
37+ file : 'slug .tgz'
3438 } ,
35- [ dir ]
39+ [ outDir ]
3640 ) ;
3741
3842 console . log ( `${ tarResponse } response` ) ;
3943
4044 const response = await fetch ( slugResult . blob . url , {
4145 method : `${ slugResult . blob . method } ` , // or 'PUT'
4246 // body: JSON.stringify(data), // data can be `string` or {object}!
43- body : `@${ dir } .tgz` ,
47+ body : `@${ dir } /slug .tgz` ,
4448 headers : {
45- 'Content-Type' : ``
49+ 'Content-Type' : ''
4650 }
4751 } ) ;
4852 console . log ( response ) ;
0 commit comments