@@ -9,6 +9,7 @@ var os = require('os');
99var fs = require ( 'fs' ) ;
1010var archiver = require ( 'archiver' ) ;
1111var ProgressBar = require ( 'progress' ) ;
12+ var child_process = require ( 'child_process' ) ;
1213var projectConfig = require ( './../projectConfig' ) ;
1314var jobs_logs = require ( './../jobs/logs.js' ) ;
1415var jobs_waitfor = require ( './../jobs/waitfor.js' ) ;
@@ -260,6 +261,7 @@ function create(params, cb) {
260261 var jobId = res . id ;
261262 console . log ( 'New jobId: ' + res . id ) ;
262263 console . log ( 'Cluster: ' + res . cluster ) ;
264+ if ( res . codeCommit ) console . log ( 'Git commit: ' + res . codeCommit ) ;
263265 console . log ( 'Job ' + res . state ) ;
264266 if ( res . state === 'Pending' ) console . log ( 'Waiting for job to run...' ) ;
265267 return jobs_waitfor ( { jobId : jobId , state : 'Running' } , function _waitforCb ( err , res ) {
@@ -324,14 +326,17 @@ function create(params, cb) {
324326 //get git hash commit
325327 fs . stat ( params . workspace + "/.git" , function ( err , stats ) {
326328 if ( err ) {
327- //exit - not a git repo
329+ //pass - not a git repo
330+ return
331+ }
332+ try {
333+ var revision = child_process . execSync ( 'git rev-parse --short HEAD' , { cwd :params . workspace } )
334+ . toString ( ) . trim ( ) ;
335+ } catch ( error ) {
336+ //pass - git issue
337+ return
328338 }
329- console . log ( params . workspace )
330- var revision = require ( 'child_process' )
331- . execSync ( 'git rev-parse --short HEAD' , { cwd :params . workspace } )
332- . toString ( ) . trim ( )
333339 params . codeCommit = revision
334- console . log ( params . codeCommit )
335340 } )
336341
337342 // zip the workspace file if it is not already a zip file
0 commit comments