Skip to content
Browse files

Updating nightly download support to use new api

  • Loading branch information...
1 parent 0e7194a commit f3f075730b29ede906e3c06f31739377f83a8b54 @kristoferjoseph kristoferjoseph committed Mar 21, 2013
Showing with 11 additions and 6 deletions.
  1. BIN .DS_Store
  2. +1 −0 .gitignore
  3. +10 −6 tasks/topcoat.js
View
BIN .DS_Store
Binary file not shown.
View
1 .gitignore
@@ -1,3 +1,4 @@
+.DS_Store
node_modules
npm-debug.log
tmp
View
16 tasks/topcoat.js
@@ -28,7 +28,9 @@ module.exports = function(grunt) {
// topcoat/button
// button.zip
var getDirectoryName = function(repo) {
- if (repo) return repo.split('/')[1];
+ if (repo) {
+ return repo.split('/')[1];
+ }
};
// If a version number is given we assume it is a tag and use this url
@@ -40,11 +42,11 @@ module.exports = function(grunt) {
var getDownloadURL = function(repo, tag) {
var downloadURL = '';
if (tag) {
- downloadURL = getTagArchiveURL(repo, tag)
+ downloadURL = getTagArchiveURL(repo, tag);
} else {
downloadURL = getNightlyArchiveURL(repo);
}
- return downloadURL
+ return downloadURL;
};
// Returns a download url for a tagged git archive
@@ -62,9 +64,11 @@ module.exports = function(grunt) {
// Returns a download url for the current master of a git repo
// repo: user/repo unique name of git repo. Ex: topcoat/button
// https://api.github.com/repos/user/repo/zipball/dev
+ // api is described here:
+ // http://developer.github.com/v3/repos/contents/#get-archive-link
var getNightlyArchiveURL = function(repo) {
var prefix = "https://api.github.com/repos/",
- suffix = "/zipball/dev";
+ suffix = "/zipball";
return prefix + repo + suffix;
};
@@ -82,7 +86,7 @@ module.exports = function(grunt) {
}
callback(error, body);
});
- }
+ };
var downloadResources = function(obj, path, callback) {
var urls = [];
@@ -99,7 +103,7 @@ module.exports = function(grunt) {
grunt.log.writeln("Downloading: " + obj.url + "\n into >> " + zipPath);
curl(obj.url, zipPath, next);
}, callback);
- }
+ };
//
// Loop over controls object

0 comments on commit f3f0757

Please sign in to comment.
Something went wrong with that request. Please try again.