-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Standardised code formatting in all files
- Loading branch information
Showing
47 changed files
with
2,439 additions
and
2,814 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,46 +1,46 @@ | ||
var util = require('util') | ||
var fs = require('fs') | ||
var exec = require('child_process').exec; | ||
var util = require( 'util' ) | ||
var fs = require( 'fs' ) | ||
var exec = require( 'child_process' ).exec; | ||
var child; | ||
|
||
var prevTag = "v0.4.2"; | ||
var nextTag = "v0.4.3"; | ||
|
||
|
||
// Executes the git log command | ||
child = exec('git log '+ prevTag +'...'+ nextTag +' --pretty=format:"{ \\"author\\" : \\"%an\\", \\"commit\\" : \\"%h\\", \\"date\\" : \\"%ar\\", \\"title\\" : \\"%s\\" },"', function (error, stdout, stderr) { | ||
|
||
var jsonStr = "{ \"data\" : [ " + stdout.toString(); | ||
jsonStr = jsonStr.substr(0, jsonStr.length - 1) + " ] } "; | ||
|
||
try { | ||
var json = JSON.parse(jsonStr); | ||
json = json.data; | ||
|
||
console.log("Parsed JSON" ) | ||
|
||
var changes = ""; | ||
for ( var i = 0, l = json.length; i < l; i++ ) | ||
changes += `* ${json[i].title} - see ${json[i].commit} \n`; | ||
|
||
try { | ||
fs.writeFile( 'changes.md', changes, function(err){ | ||
if (err) | ||
throw err; | ||
console.log('It\'s saved!'); | ||
}); | ||
} | ||
catch(err){ | ||
console.log('Could not write file: ' + err); | ||
} | ||
} | ||
catch(err){ | ||
console.log('Could not parse JSON: ' + err); | ||
console.log('JSON STRING: ' + jsonStr); | ||
} | ||
|
||
|
||
if (error !== null) { | ||
console.log('exec error: ' + error); | ||
} | ||
child = exec( 'git log ' + prevTag + '...' + nextTag + ' --pretty=format:"{ \\"author\\" : \\"%an\\", \\"commit\\" : \\"%h\\", \\"date\\" : \\"%ar\\", \\"title\\" : \\"%s\\" },"', function( error, stdout, stderr ) { | ||
|
||
var jsonStr = "{ \"data\" : [ " + stdout.toString(); | ||
jsonStr = jsonStr.substr( 0, jsonStr.length - 1 ) + " ] } "; | ||
|
||
try { | ||
var json = JSON.parse( jsonStr ); | ||
json = json.data; | ||
|
||
console.log( "Parsed JSON" ) | ||
|
||
var changes = ""; | ||
for ( var i = 0, l = json.length; i < l; i++ ) | ||
changes += `* ${json[ i ].title} - see ${json[ i ].commit} \n`; | ||
|
||
try { | ||
fs.writeFile( 'changes.md', changes, function( err ) { | ||
if ( err ) | ||
throw err; | ||
console.log( 'It\'s saved!' ); | ||
}); | ||
} | ||
catch ( err ) { | ||
console.log( 'Could not write file: ' + err ); | ||
} | ||
} | ||
catch ( err ) { | ||
console.log( 'Could not parse JSON: ' + err ); | ||
console.log( 'JSON STRING: ' + jsonStr ); | ||
} | ||
|
||
|
||
if ( error !== null ) { | ||
console.log( 'exec error: ' + error ); | ||
} | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.