include actual github repo when used on github repo

This commit is contained in:
Vitaly 2023-08-11 04:21:41 +03:00
parent c135855095
commit 2b363f1515
3 changed files with 10 additions and 3 deletions

View file

@ -57,7 +57,7 @@ class PauseScreen extends LitElement {
<main>
<pmui-button pmui-width="204px" pmui-label="Back to Game" @pmui-click=${this.onReturnPress}></pmui-button>
<div class="row">
<pmui-button pmui-width="98px" pmui-label="Github" @pmui-click=${() => openURL('https://github.com/PrismarineJS/prismarine-web-client')}></pmui-button>
<pmui-button pmui-width="98px" pmui-label="Github" @pmui-click=${() => openURL(process.env.GITHUB_URL)}></pmui-button>
<pmui-button pmui-width="98px" pmui-label="Discord" @pmui-click=${() => openURL('https://discord.gg/4Ucm684Fq3')}></pmui-button>
</div>
<pmui-button pmui-width="204px" pmui-label="Options" @pmui-click=${() => showModal(document.getElementById('options-screen'))}></pmui-button>

View file

@ -113,7 +113,7 @@ class TitleScreen extends LitElement {
}}></pmui-button>
<pmui-button pmui-width="200px" pmui-label="Options" @pmui-click=${() => showModal(document.getElementById('options-screen'))}></pmui-button>
<div class="menu-row">
<pmui-button pmui-width="98px" pmui-label="Github" @pmui-click=${() => openURL('https://github.com/PrismarineJS/prismarine-web-client')}></pmui-button>
<pmui-button pmui-width="98px" pmui-label="Github" @pmui-click=${() => openURL(process.env.GITHUB_URL)}></pmui-button>
<pmui-button pmui-width="98px" pmui-label="Discord" @pmui-click=${() => openURL('https://discord.gg/4Ucm684Fq3')}></pmui-button>
</div>
</div>

View file

@ -8,6 +8,7 @@ const webpack = require('webpack')
module.exports = merge(common, {
mode: 'production',
devtool: 'source-map',
plugins: [
new CleanWebpackPlugin(),
new webpack.optimize.ModuleConcatenationPlugin(),
@ -19,5 +20,11 @@ module.exports = merge(common, {
skipWaiting: true,
include: ['index.html', 'manifest.json'] // not caching a lot as anyway this works only online
}),
]
new webpack.ProvidePlugin({
// get from github actions or vercel env
GITHUB_URL: process.env.VERCEL_GIT_REPO_OWNER
? `https://github.com/${process.env.VERCEL_GIT_REPO_OWNER}/${process.env.VERCEL_GIT_REPO_SLUG}`
: process.env.GITHUB_REPOSITORY
})
],
})