Skip to content

Commit

Permalink
feat: fallback to git install if no versions are available
Browse files Browse the repository at this point in the history
  • Loading branch information
favoyang committed Dec 15, 2019
1 parent 3dba78a commit c6b2498
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 5 deletions.
4 changes: 2 additions & 2 deletions data/packages/com.grochoska.comm-unity-store.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ description: >-
CommUnity Store is a tool to help developers to find the best open source
packages and import them right into the project.
repoUrl: 'https://github.com/RafaelGrochoska/CommUnityStore'
repoBranch: master
packageFolder: Assets/CommUnityStore
repoBranch: upm
packageFolder: ''
parentUrl: null
licenseSpdxId: MIT
licenseName: MIT License
Expand Down
16 changes: 13 additions & 3 deletions docs/.vuepress/theme/layouts/PackageDetail.vue
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@
class="bg-gray text-primary text-bold"
data-lang="shell"
>
openupm add {{ $package.name }}
{{ packageInstallCli }}
</code>
<div class="action text-right">
<a
Expand Down Expand Up @@ -288,6 +288,16 @@ export default {
count += (repoInfo.parent && repoInfo.parent.stargazers_count) || 0;
return count;
},
packageInstallCli() {
if (this.packageSucceededBuilds.length)
return `openupm add ${this.$package.name}`;
else if (!this.$package.packageFolder) {
let cli = `openupm add ${this.$package.name}@${this.$package.repoUrl}`;
if (this.$package.repoBranch != "master")
cli += "#this.$package.repoBranch";
return cli;
} else return "not available";
},
readmeHtml() {
if (!this.$data.readmeRaw) return "";
else {
Expand Down Expand Up @@ -412,8 +422,7 @@ See more in the [${this.$package.repo}](${this.$package.repoUrl}) repository.
}
},
onCopyClick() {
const text = `openupm add ${this.$package.name}`;
copy(text, { format: "text/plain" });
copy(this.packageInstallCli, { format: "text/plain" });
}
}
};
Expand Down Expand Up @@ -458,6 +467,7 @@ See more in the [${this.$package.repo}](${this.$package.repoUrl}) repository.
display block
margin-bottom 0.4rem
padding 1.1rem 0.4rem 0.8rem
overflow-wrap break-word
&:before
color #bcc3ce
content attr(data-lang)
Expand Down

0 comments on commit c6b2498

Please sign in to comment.