mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-08-28 22:08:54 -04:00
Gulp: Implement publish task.
This commit is contained in:
parent
f803afa4b6
commit
1a3a4be0b6
8 changed files with 65 additions and 14 deletions
|
@ -10,7 +10,8 @@
|
|||
* All rights reserved.
|
||||
*/
|
||||
|
||||
var gitty = require('gitty');
|
||||
var gitty = require('gitty'),
|
||||
extend = require('extend');
|
||||
|
||||
// Require the __options object, so we have access to the version number and
|
||||
// make amendments, e.g. the release date.
|
||||
|
@ -27,8 +28,11 @@ function git(param) {
|
|||
// Get the date of the last commit from this branch for release date:
|
||||
options.date = git('log -1 --pretty=format:%ad');
|
||||
// If we're not on the master branch, append the branch name to the version:
|
||||
var branch = git('rev-parse --abbrev-ref HEAD');
|
||||
if (branch !== 'master')
|
||||
options.version += '-' + branch;
|
||||
var branch = git('rev-parse --abbrev-ref HEAD'),
|
||||
suffix = branch === 'master' ? '' : '-' + branch;
|
||||
|
||||
module.exports = options;
|
||||
module.exports = function(opts) {
|
||||
return extend({}, options, opts && opts.suffix && {
|
||||
version: options.version + suffix
|
||||
});
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue