code: function gruntPrepareRelease () {
  
          var bower = grunt.file.readJSON('bower.json');
          var version = bower.version;
  
          if (version !== grunt.config('pkg.version')) {
              throw new Error('Version mismatch in bower.json');
          }
  
          function searchForExistingTag () {
              return exec('git tag -l \"' + version + '\"');
          }
  
          function setGruntConfig (searchResult) {
  
              if ('' !== searchResult.stdout.trim()) {
                  throw new Error('Tag \'' + version + '\' already exists');
              }
  
              grunt.config('buildTag', '');
              grunt.config('buildDir', releaseDirName);
  
          }
  
          var done = this.async();
  
          ensureCleanMaster()
              .then(searchForExistingTag)
              .then(setGruntConfig)
              .then(function () {
                  done();
              })
              .catch(handleAsyncError.bind(undefined, done))
              .done();
  
      }
docs: Grunt Task Functions