Navigation Menu

Skip to content
This repository has been archived by the owner on Jan 31, 2018. It is now read-only.

Commit

Permalink
Merge pull request #298 from humphd/t791
Browse files Browse the repository at this point in the history
Add build step for stamping Butter with git commit sha version info.
  • Loading branch information
secretrobotron committed May 25, 2012
2 parents b0570be + c26facb commit 7d0e566
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
6 changes: 6 additions & 0 deletions make.js
Expand Up @@ -75,6 +75,12 @@ target.build = function() {
exec(RJS + ' -o tools/build.js');
exec(RJS + ' -o tools/build.optimized.js');

// Stamp Butter.version with the git commit sha we are using
var version = exec('git describe',
{silent:true}).output.replace(/\r?\n/m, "");
sed('-i', '@VERSION@', version, 'dist/butter.js');
sed('-i', '@VERSION@', version, 'dist/butter.min.js');

exec(STYLUS + ' css');
cp('css/*.css', DIST_DIR);
};
Expand Down
4 changes: 4 additions & 0 deletions src/main.js
Expand Up @@ -737,6 +737,10 @@

Butter.instances = __instances;

// Butter will report a version, which is the git commit sha
// of the version we ship. This happens in make.js's build target.
Butter.version = "@VERSION@";

if ( window.Butter.__waiting ) {
for ( var i=0, l=window.Butter.__waiting.length; i<l; ++i ) {
Butter.apply( {}, window.Butter.__waiting[ i ] );
Expand Down

0 comments on commit 7d0e566

Please sign in to comment.