mirror of
https://github.com/laurent22/joplin.git
synced 2024-11-27 08:21:03 +02:00
Plugin repo: Fixing fetch tool
This commit is contained in:
parent
bc9dac2feb
commit
af344601ec
@ -1,7 +1,11 @@
|
||||
import { githubOauthToken } from '@joplin/tools/tool-utils';
|
||||
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 fetch = require('node-fetch');
|
||||
|
||||
const apiBaseUrl = 'https://api.github.com/repos/joplin/plugins';
|
||||
|
||||
@ -25,6 +29,7 @@ interface ReleaseAsset {
|
||||
|
||||
interface Release {
|
||||
upload_url: string;
|
||||
html_url: string;
|
||||
assets: ReleaseAsset[];
|
||||
}
|
||||
|
||||
@ -123,6 +128,8 @@ async function saveStats(statFilePath: string, stats: any) {
|
||||
|
||||
export default async function(args: Args) {
|
||||
const release = await getRelease();
|
||||
console.info(`Got release with ${release.assets.length} assets from ${release.html_url}`);
|
||||
|
||||
const statFilePath = `${args.pluginRepoDir}/stats.json`;
|
||||
const stats = await createStats(statFilePath, release);
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@joplin/plugin-repo-cli",
|
||||
"version": "2.6.7",
|
||||
"version": "2.6.8",
|
||||
"description": "",
|
||||
"main": "index.js",
|
||||
"bin": "./dist/index.js",
|
||||
|
Loading…
Reference in New Issue
Block a user