Skip to content

Commit 095e82f

Browse files
authored
Merge pull request #16 from bob-ross27/feature/v0.2.4
Added Bob-Ross to sellers.
2 parents 4958edf + a0943d0 commit 095e82f

4 files changed

Lines changed: 24 additions & 7 deletions

File tree

ExtensionStore/lib/store.js

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -519,17 +519,33 @@ Object.defineProperty(Repository.prototype, "extensions", {
519519
});
520520

521521

522-
523522
/**
524523
* The git tree url for the master branch of this repository
525524
* @type {string} The url of the tree file representing the contents of a repository
526525
*/
527526
Object.defineProperty(Repository.prototype, "masterBranchTree", {
528527
get: function () {
529528
if (typeof this._tree === 'undefined') {
530-
this.log.debug(this.apiUrl + "branches/master")
529+
// Try to get the master branch.
531530
var tree = webQuery.get(this.apiUrl + "branches/master");
532-
if (tree) this._tree = tree.commit.commit.tree.url; // the query returns a big object in which this is the address of the contents tree
531+
532+
// Return doesn't contain a commit - indicating it's likely an error
533+
// or a redirect.
534+
if (tree && !tree.commit) {
535+
// Redirect provided, so get from the provided url instead.
536+
if (tree.url && tree.message === "Moved Permanently") {
537+
// Github redirect returns invalid url, fix with a replace.
538+
tree = webQuery.get(tree.url.replace("repositories", "repos"));
539+
}
540+
}
541+
542+
// Assign url or throw error if no valid branch could be detected.
543+
if (tree && tree.commit) {
544+
this._tree = tree.commit.commit.tree.url; // the query returns a big object in which this is the address of the contents tree
545+
}
546+
else {
547+
throw new Error("Unable to find a valid branch.");
548+
}
533549
}
534550
return this._tree
535551
}

ExtensionStore/tbpackage.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{
22
"name": "ExtensionStore",
3-
"version": "0.2.3",
3+
"version": "0.2.4",
44
"compatibility": "Harmony Premium 16",
5-
"description": "Changelog: further refactoring of files.",
5+
"description": "Changelog: Additional support for branches not named master.",
66
"isPackage": "true",
77
"repository": "https://github.com/mchaptel/ExtensionStore/",
88
"files": [

SELLERSLIST

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,5 @@
44
"https://github.com/cfourney/OpenHarmony/",
55
"https://github.com/yueda1984/MC-Load-Poses-On-Selected-Frames/",
66
"https://github.com/alarigger/AL_Expose_All_Substitutions/"
7+
"https://github.com/bob-ross27/toonboom/"
78
]

packages/ExtensionStore/tbpackage.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{
22
"name": "ExtensionStore",
3-
"version": "0.2.3",
3+
"version": "0.2.4",
44
"compatibility": "Harmony Premium 16",
5-
"description": "Changelog: further refactoring of files.",
5+
"description": "Changelog: Additional support for branches not named master.",
66
"isPackage": "true",
77
"repository": "https://github.com/mchaptel/ExtensionStore/",
88
"files": [

0 commit comments

Comments
 (0)