Skip to content

Commit 3366be1

Browse files
committed
⬆️ Upgrade: update picgo core
1 parent 5cd019d commit 3366be1

File tree

3 files changed

+12
-13
lines changed

3 files changed

+12
-13
lines changed

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -357,7 +357,7 @@
357357
"dependencies": {
358358
"lodash": "^4.17.19",
359359
"lodash-id": "^0.14.0",
360-
"picgo": "1.4.14"
360+
"picgo": "1.4.17"
361361
},
362362
"license": "MIT"
363-
}
363+
}

src/vs-picgo/index.ts

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,15 @@ import * as path from 'path';
44
import * as os from 'os';
55
import * as vscode from 'vscode';
66

7-
import PicGo from 'picgo/dist/src/core/PicGo';
8-
import { IImgInfo, IPlugin, IConfig as IPicGoConfig } from 'picgo/dist/src/utils/interfaces';
9-
107
import { promisify } from 'util';
118

129
import { formatParam, formatString, showInfo, showError, getUploadedName } from '../utils';
1310

1411
const _ = require('lodash');
1512
const _db = require('lodash-id');
1613
import nls = require('../../package.nls.json');
14+
import { IImgInfo, IPlugin, IPicGo, IConfig } from 'picgo/dist/src/types';
15+
import PicGo = require('picgo');
1716
_.mixin(_db);
1817

1918
const writeFileP = promisify(fs.writeFile);
@@ -45,7 +44,7 @@ export enum EVSPicgoHooks {
4544
}
4645

4746
export default class VSPicgo extends EventEmitter {
48-
private static picgo: PicGo = new PicGo();
47+
private static picgo: IPicGo = new PicGo();
4948

5049
constructor() {
5150
super();
@@ -58,15 +57,15 @@ export default class VSPicgo extends EventEmitter {
5857

5958
configPicgo() {
6059
const picgoConfigPath = vscode.workspace.getConfiguration('picgo').get<string>('configPath');
61-
let config: Partial<IPicGoConfig>;
60+
let config: Partial<IConfig>;
6261
if (picgoConfigPath) {
6362
config = JSON.parse(
6463
fs.readFileSync(picgoConfigPath, {
6564
encoding: 'utf-8',
6665
}),
6766
);
6867
} else {
69-
const picBed = (vscode.workspace.getConfiguration('picgo.picBed') as any) as IPicGoConfig['picBed'];
68+
const picBed = (vscode.workspace.getConfiguration('picgo.picBed') as any) as IConfig['picBed'];
7069
config = { picBed };
7170
}
7271

@@ -111,7 +110,7 @@ export default class VSPicgo extends EventEmitter {
111110

112111
registerRenamePlugin() {
113112
let beforeUploadPlugin: IPlugin = {
114-
handle: (ctx: PicGo) => {
113+
handle: (ctx: IPicGo) => {
115114
const uploadNameTemplate =
116115
vscode.workspace.getConfiguration('picgo').get<string>('customUploadName') || '${fileName}';
117116
if (ctx.output.length === 1) {

yarn.lock

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4142,10 +4142,10 @@ performance-now@^2.1.0:
41424142
version "2.1.0"
41434143
resolved "https://registry.npm.taobao.org/performance-now/download/performance-now-2.1.0.tgz#6309f4e0e5fa913ec1c69307ae364b4b377c9e7b"
41444144

4145-
picgo@1.4.14:
4146-
version "1.4.14"
4147-
resolved "https://registry.npm.taobao.org/picgo/download/picgo-1.4.14.tgz#312a1814d35eb8e326587d5cd99316b09a2882cc"
4148-
integrity sha1-MSoYFNNeuOMmWH1c2ZMWsJoogsw=
4145+
picgo@1.4.17:
4146+
version "1.4.17"
4147+
resolved "https://registry.npm.taobao.org/picgo/download/picgo-1.4.17.tgz#db8f019c061b2bc96b71072760066b3dd829c774"
4148+
integrity sha1-248BnAYbK8lrcQcnYAZrPdgpx3Q=
41494149
dependencies:
41504150
chalk "^2.4.1"
41514151
commander "^2.17.0"

0 commit comments

Comments
 (0)