-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(conventional-changelog): add conventional-changelog gulp support
It's based on 0.0.11, a ticket is open to ask for the equivalent in 0.5.1 (conventional-changelog/conventional-changelog#117)
- Loading branch information
1 parent
7f48603
commit e8c4d96
Showing
4 changed files
with
43 additions
and
0 deletions.
There are no files selected for viewing
Empty file.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
/** | ||
* angularjs-jspm-seed | ||
* Created by kdavin on 22/10/2015. | ||
*/ | ||
import gulp from "gulp"; | ||
import fs from 'fs'; | ||
import cg from 'conventional-changelog'; | ||
import util from 'gulp-util'; | ||
import paths from '../paths'; | ||
|
||
const argv = util.env; | ||
const from = argv.from, to = argv.to; | ||
|
||
// Conventional Changelog Generating Task | ||
// Can be use with '--from START_COMMIT --to END_COMMIT --version RELEASED_VERSION_NAME' | ||
// ex : gulp conventional-changelog --from 70a938f811256262b8411d9f05d91f600eac4123 | ||
// it generate all the changelog from the commit id to today, it is useful to use the last commit id of the changelog.md | ||
gulp.task('conventional-changelog', function(cal){ | ||
function changeParsed(err, log){ | ||
if (err) { | ||
return cal(err); | ||
} | ||
fs.writeFile(paths.changeLog, log); | ||
} | ||
fs.readFile(paths.packageJson, 'utf8', function(err, data){ | ||
var ref$, repository, version; | ||
ref$ = JSON.parse(data), repository = ref$.repository, version = argv.vname || ref$.version; | ||
cg({ | ||
repository: repository.url, | ||
version: version, | ||
from: from, | ||
to: to | ||
}, changeParsed); | ||
}); | ||
}); |
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