Dist version (#854)
* unique branch for each version * fix: json_plugins * update readme
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
# LNReader Plugins
|
# LNReader Plugins
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
<img alt="LNReader plugins counting" src="https://raw.githubusercontent.com/LNReader/lnreader-sources/dist/total.svg">
|
<img alt="LNReader plugins counting" src="https://raw.githubusercontent.com/LNReader/lnreader-sources/plugins/v2.0.0/total.svg">
|
||||||
<img alt="GitHub issues by-label" src="https://img.shields.io/github/issues/lnreader/lnreader-sources/Source%20Request?color=success&label=source%20requests">
|
<img alt="GitHub issues by-label" src="https://img.shields.io/github/issues/lnreader/lnreader-sources/Source%20Request?color=success&label=source%20requests">
|
||||||
<img alt="GitHub issues by-label" src="https://img.shields.io/github/issues/lnreader/lnreader-sources/Bug?color=red&label=bugs">
|
<img alt="GitHub issues by-label" src="https://img.shields.io/github/issues/lnreader/lnreader-sources/Bug?color=red&label=bugs">
|
||||||
</p>
|
</p>
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
$current=$(git rev-parse --abbrev-ref HEAD)
|
$current=$(git rev-parse --abbrev-ref HEAD)
|
||||||
$dist='dist'
|
$version=$(node -e "console.log(require('./package.json').version);")
|
||||||
|
$dist="plugins/v$($version)"
|
||||||
$exists=$(git show-ref refs/heads/$dist)
|
$exists=$(git show-ref refs/heads/$dist)
|
||||||
|
|
||||||
if ($exists){
|
if ($exists){
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
current=`git rev-parse --abbrev-ref HEAD`
|
current=`git rev-parse --abbrev-ref HEAD`
|
||||||
dist=dist
|
version=`node -e "console.log(require('./package.json').version);"`
|
||||||
|
dist="plugins/v$version"
|
||||||
exists=`git show-ref refs/heads/$dist`
|
exists=`git show-ref refs/heads/$dist`
|
||||||
|
|
||||||
if [ -n "$exists" ]; then
|
if [ -n "$exists" ]; then
|
||||||
|
|||||||
+11
-15
@@ -12,14 +12,9 @@ const { execSync } = require('child_process');
|
|||||||
const REMOTE = execSync('git remote get-url origin')
|
const REMOTE = execSync('git remote get-url origin')
|
||||||
.toString()
|
.toString()
|
||||||
.replace(/[\s\n]/g, '');
|
.replace(/[\s\n]/g, '');
|
||||||
let CURRENT_BRANCH = 'dist';
|
const CURRENT_BRANCH = execSync('git branch --show-current')
|
||||||
try {
|
.toString()
|
||||||
CURRENT_BRANCH = execSync('git rev-parse --abbrev-ref HEAD')
|
.replace(/[\s\n]/g, '');
|
||||||
.toString()
|
|
||||||
.replace(/[\s\n]/g, '');
|
|
||||||
} catch {
|
|
||||||
//
|
|
||||||
}
|
|
||||||
const matched = REMOTE.match(/([^:/]+?)\/([^/.]+)(\.git)?$/);
|
const matched = REMOTE.match(/([^:/]+?)\/([^/.]+)(\.git)?$/);
|
||||||
if (!matched) throw Error('Cant parse git url');
|
if (!matched) throw Error('Cant parse git url');
|
||||||
const USERNAME = matched[1];
|
const USERNAME = matched[1];
|
||||||
@@ -90,13 +85,14 @@ for (let lang in json) json[lang].sort((a, b) => a.id.localeCompare(b.id));
|
|||||||
|
|
||||||
fs.writeFileSync(jsonMinPath, JSON.stringify(json));
|
fs.writeFileSync(jsonMinPath, JSON.stringify(json));
|
||||||
fs.writeFileSync(jsonPath, JSON.stringify(json, null, '\t'));
|
fs.writeFileSync(jsonPath, JSON.stringify(json, null, '\t'));
|
||||||
if (CURRENT_BRANCH === 'dist') {
|
fetch(`https://img.shields.io/badge/Plugins-${totalPlugins}-blue`)
|
||||||
fetch(`https://img.shields.io/badge/Plugins-${totalPlugins}-blue`)
|
.then(res => res.text())
|
||||||
.then(res => res.text())
|
.then(data => {
|
||||||
.then(data => {
|
fs.writeFileSync('total.svg', data, { encoding: 'utf-8' });
|
||||||
fs.writeFileSync('total.svg', data, { encoding: 'utf-8' });
|
})
|
||||||
});
|
.catch(error => {
|
||||||
}
|
fs.writeFileSync('total.svg', '', { encoding: 'utf-8' });
|
||||||
|
});
|
||||||
|
|
||||||
// check for broken plugins
|
// check for broken plugins
|
||||||
for (let language in languages) {
|
for (let language in languages) {
|
||||||
|
|||||||
Reference in New Issue
Block a user