damkraw / grunt-gitinfo Goto Github PK
View Code? Open in Web Editor NEWGet Git info from a working copy and populate grunt.config with the data
License: MIT License
Get Git info from a working copy and populate grunt.config with the data
License: MIT License
Tagging releases in git makes it much easier to figure out what version you're on, I highly recommend tagging releases as you bump your npm version number.
please bring example, how to use it? How to tune Grunt config by gitinfo data?
For example if I want to pass last commit name to https://github.com/tschaub/grunt-gh-pages.
I want to list the first line of all commits since the last tag starting with release-
. On the command line, the command would be:
git log --oneline $(git describe --tags --match="release-*" --abbrev=0)..HEAD
How can this be achieved with gitinfo?
gitinfo: {
commands: {
'release.last.tag': ['describe', '--tags', '--match=release-*', '--abbrev=0'],
'log.since.last.release': ['log', '--oneline', '<%= grunt.config.get("gitinfo.release.last.tag") %>..HEAD']
}
}
I tried something like that, but since gitinfo performs custom commands asynchronously, I does not work.
Any ideas?
there is new security issue for lodash below 4.17.11. everytime i run audit, it always give me security vulnerability for lodash in grunt-gitinfo package
With the newest version bump to 0.1.2 I am receiving this error when running grunt gitinfo
Warning: Cannot read property 'options' of undefined Use --force to continue.
It just doesn't work... no matter all the different variations I tried...
http://gruntjs.com/blog/2016-04-04-grunt-1.0.0-released#peer-dependencies
PR already submitted. Thanks.
Cannot read the commit SHA of the current HEAD from the /home/ubuntu/gitrepo/.git/refs/heads/master.
Seems like git gc
is emptying the refs/heads dir and gitinfo fails to get the commit sha
For instance:
$ grunt gitinfo
Running "gitinfo" task
[gitinfo]: couldn't set config: local.branch.current.tag
I think having no tags is a valid state and should just return null for the local.branch.current.tag
property.
First of all, thank you for your work.
The output of all the commands with --format option (lastCommitTime, lastCommitMessage, lastCommitAuthor) is surrounded with double quotes.
Is there any specific reason? I mean, the format option in git doesn't need double quotes, and it is giving me some troubles using it with preprocess/usemin while putting in an html attribute.
If I can suggest a change, it would simply be to remove double quotes from the option
'local.branch.current.lastCommitTime' : ['log', '--format=%ai', '-n1', 'HEAD'], 'local.branch.current.lastCommitMessage' : ['log', '--format=%B', '-n1', 'HEAD'], 'local.branch.current.lastCommitAuthor' : ['log', '--format=%aN', '-n1', 'HEAD'],
If you agree I can submit a PR.
Cheers
I want to create grunt task that is going to write git information to file. However, I am not getting any git information. I followed instructions but cannot figure out what I am doing wrong. Inside my grunt file I have following:
grunt.loadNpmTasks('grunt-gitinfo');
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
gitinfo: {},
....
})
....
grunt.registerTask('gitVersion', [
'gitinfo'
]);
grunt.registerTask('version', 'Creates an empty file', function() {
var git = grunt.config().gitinfo;
var pjson = require('./package.json');
console.log(pjson.version);
grunt.file.write('VERSION.txt', "Version: " + pjson.version + "\r\n" + git);
});
After running the task new file is created and psjon.version is written but git object remains empty.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.