You've already forked joplin
mirror of
https://github.com/laurent22/joplin.git
synced 2025-11-26 22:41:17 +02:00
Plugin repo: Fixing fetch tool
This commit is contained in:
@@ -1,7 +1,11 @@
|
|||||||
import { githubOauthToken } from '@joplin/tools/tool-utils';
|
import { githubOauthToken } from '@joplin/tools/tool-utils';
|
||||||
import { pathExists, readdir, readFile, stat, writeFile } from 'fs-extra';
|
import { pathExists, readdir, readFile, stat, writeFile } from 'fs-extra';
|
||||||
|
|
||||||
|
// We need to require `.default` due to this issue:
|
||||||
|
// https://github.com/node-fetch/node-fetch/issues/450#issuecomment-387045223
|
||||||
|
const fetch = require('node-fetch').default;
|
||||||
|
|
||||||
const ghReleaseAssets = require('gh-release-assets');
|
const ghReleaseAssets = require('gh-release-assets');
|
||||||
const fetch = require('node-fetch');
|
|
||||||
|
|
||||||
const apiBaseUrl = 'https://api.github.com/repos/joplin/plugins';
|
const apiBaseUrl = 'https://api.github.com/repos/joplin/plugins';
|
||||||
|
|
||||||
@@ -25,6 +29,7 @@ interface ReleaseAsset {
|
|||||||
|
|
||||||
interface Release {
|
interface Release {
|
||||||
upload_url: string;
|
upload_url: string;
|
||||||
|
html_url: string;
|
||||||
assets: ReleaseAsset[];
|
assets: ReleaseAsset[];
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -123,6 +128,8 @@ async function saveStats(statFilePath: string, stats: any) {
|
|||||||
|
|
||||||
export default async function(args: Args) {
|
export default async function(args: Args) {
|
||||||
const release = await getRelease();
|
const release = await getRelease();
|
||||||
|
console.info(`Got release with ${release.assets.length} assets from ${release.html_url}`);
|
||||||
|
|
||||||
const statFilePath = `${args.pluginRepoDir}/stats.json`;
|
const statFilePath = `${args.pluginRepoDir}/stats.json`;
|
||||||
const stats = await createStats(statFilePath, release);
|
const stats = await createStats(statFilePath, release);
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@joplin/plugin-repo-cli",
|
"name": "@joplin/plugin-repo-cli",
|
||||||
"version": "2.6.7",
|
"version": "2.6.8",
|
||||||
"description": "",
|
"description": "",
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
"bin": "./dist/index.js",
|
"bin": "./dist/index.js",
|
||||||
|
|||||||
Reference in New Issue
Block a user