mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-08-28 22:08:54 -04:00
Split gulpfile.js into separate task files.
This commit is contained in:
parent
145135b4f5
commit
eda738d4fa
12 changed files with 320 additions and 226 deletions
34
gulp/utils/options.js
Normal file
34
gulp/utils/options.js
Normal file
|
@ -0,0 +1,34 @@
|
|||
/*
|
||||
* Paper.js - The Swiss Army Knife of Vector Graphics Scripting.
|
||||
* http://paperjs.org/
|
||||
*
|
||||
* Copyright (c) 2011 - 2016, Juerg Lehni & Jonathan Puckey
|
||||
* http://scratchdisk.com/ & http://jonathanpuckey.com/
|
||||
*
|
||||
* Distributed under the MIT license. See LICENSE file for details.
|
||||
*
|
||||
* All rights reserved.
|
||||
*/
|
||||
|
||||
var gitty = require('gitty');
|
||||
|
||||
// Require the __options object, so we have access to the version number and
|
||||
// make amendments, e.g. the release date.
|
||||
var options = require('../../src/options.js'),
|
||||
repo = gitty('.');
|
||||
|
||||
function git(param) {
|
||||
var args = arguments.length === 1 ? param.split(' ')
|
||||
: [].slice.apply(arguments),
|
||||
operation = args.shift();
|
||||
return new gitty.Command(repo, operation, args).execSync().trim();
|
||||
}
|
||||
|
||||
// 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;
|
||||
|
||||
module.exports = options;
|
Loading…
Add table
Add a link
Reference in a new issue