Skip to content

Commit

Permalink
Merge pull request #12 from FATMAP/2021-06-01-capture-error
Browse files Browse the repository at this point in the history
print errors. fix status
  • Loading branch information
varunsridharan authored Aug 3, 2021
2 parents 3751721 + c8e32fd commit 88c6ab5
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions src/helper.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,14 @@ const repositoryDetails = ( input_repo ) => {

const repositoryClone = async( git_url, local_path, branch, auto_create_branch ) => {
const common_arg = '--quiet --no-hardlinks --no-tags';
const options = { silent: true };
let stauts = true;
const options = { silent: false };
let status = true;
if( 'default' === branch ) {
await exec.exec( `git clone ${common_arg} --depth 1 ${git_url} "${local_path}"`, [], options )
.then( () => toolkit.log.success( 'Repository Cloned', ' ' ) )
.catch( () => {
toolkit.log.error( 'Repository Dose Not Exists !', ' ' );
stauts = false;
toolkit.log.error( 'Unable to Clone Repository!', ' ' );
status = false;
} );
} else {
await exec.exec( `git clone ${common_arg} --depth 1 --branch "${branch}" ${git_url} "${local_path}"`, [], options )
Expand All @@ -44,24 +44,24 @@ const repositoryClone = async( git_url, local_path, branch, auto_create_branch )
.then( () => {
toolkit.log.success( 'Repository Cloned', ' ' );
toolkit.log.success( 'Branch Created', ' ' );
stauts = 'created';
status = 'created';
} )
.catch( () => {
toolkit.log.error( 'Unable To Create Branch.', ' ' );
stauts = false;
status = false;
} );
} )
.catch( () => {
toolkit.log.error( 'Repository Dose Not Exists !', ' ' );
stauts = false;
status = false;
} );
} else {
toolkit.log.error( `Repository Branch ${branch} Not Found!`, ' ' );
stauts = false;
status = false;
}
} );
}
return stauts;
return status;
};

const extract_workflow_file_info = ( file ) => {
Expand Down

0 comments on commit 88c6ab5

Please sign in to comment.