Skip to content

Commit

Permalink
make publish upload package.json
Browse files Browse the repository at this point in the history
  • Loading branch information
greggman committed Sep 9, 2014
1 parent ba6c33c commit 184d511
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions management/publish.js
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,13 @@ var publish = function(gamePath, options) {
repoName = repoName.substring(0, repoName.length - 4);
}

var stuffToDelete = [];
var cleanup = function() {
stuffToDelete.forEach(function(filePath) {
utils.deleteNoFail(filePath);
});
};

var info = runtimeInfo.info;
var hftInfo = info.happyFunTimes;
var github = new GitHubApi({
Expand Down Expand Up @@ -208,6 +215,9 @@ var publish = function(gamePath, options) {
export: true,
});
}).then(function(files) {
files.forEach(function(file) {
stuffToDelete.push(file.filename);
});
filesToUpload = files;
console.log("Upload:\n" + files.map(function(file) {
return " " + file.filename;
Expand All @@ -228,6 +238,7 @@ var publish = function(gamePath, options) {
log("releaseInfo", releaseInfo);
var promises = [];
var results = [];
filesToUpload.push({filename: path.join(runtimeInfo.basePath, "package.json")});
filesToUpload.forEach(function(file, ndx) {
auth();
promises.push(uploadAsset({
Expand Down Expand Up @@ -256,9 +267,11 @@ var publish = function(gamePath, options) {
})
}).then(function() {
console.log(gameId + ": registered");
cleanup();
fulfill();
}).catch(function(err) {
reject(err)
cleanup();
});
});
};
Expand Down

0 comments on commit 184d511

Please sign in to comment.