Skip to content

Commit 5616fb9

Browse files
committed
🐛 Fix: build error in windows
1 parent f2f5ba6 commit 5616fb9

File tree

5 files changed

+9
-9
lines changed

5 files changed

+9
-9
lines changed

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
"start": "node ./bin/picgo",
1616
"lint": "eslint src/**/*.ts && npm run build",
1717
"test": "echo \"Error: no test specified\" && exit 1",
18-
"build": "rm -rf ./dist && rollup -c rollup.config.js && ls -lh dist",
18+
"build": "rimraf ./dist && rollup -c rollup.config.js",
1919
"dev": "rollup -c rollup.config.js -w",
2020
"patch": "npm version patch && git push origin master && git push origin --tags",
2121
"minor": "npm version minor && git push origin master && git push origin --tags",
@@ -115,7 +115,7 @@
115115
"request": "^2.87.0",
116116
"request-promise-native": "^1.0.5",
117117
"resolve": "^1.8.1",
118-
"rimraf": "^2.6.3"
118+
"rimraf": "^3.0.2"
119119
},
120120
"repository": {
121121
"type": "git",

src/lib/Logger.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,12 +47,12 @@ export class Logger implements ILogger {
4747
let log = `${dayjs().format('YYYY-MM-DD HH:mm:ss')} [PicGo ${type.toUpperCase()}] `
4848
msg.forEach((item: ILogArgvTypeWithError) => {
4949
if (typeof item === 'object' && type === 'error') {
50-
log += `\n------Error Stack Begin------\n${util.format(item.stack)}\n-------Error Stack End------- `
50+
log += `\n------Error Stack Begin------\n${util.format(item?.stack)}\n-------Error Stack End------- `
5151
} else {
5252
if (typeof item === 'object') {
5353
item = JSON.stringify(item)
5454
}
55-
log += `${item} `
55+
log += `${item as string} `
5656
}
5757
})
5858
log += '\n'

src/lib/PluginHandler.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -229,8 +229,8 @@ export class PluginHandler implements IPluginHandler {
229229
this.ctx.log.error('NPM is not installed')
230230
this.ctx.emit(IBuildInEvent.FAILED, 'NPM is not installed')
231231
})
232-
} catch (e: any) {
233-
this.ctx.log.error(e)
232+
} catch (e) {
233+
this.ctx.log.error(e as Error)
234234
this.ctx.emit(IBuildInEvent.FAILED, e)
235235
}
236236
})

src/lib/PluginLoader.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,11 +92,11 @@ export class PluginLoader implements IPluginLoader {
9292
this.pluginMap.set(name, pluginInterface)
9393
plugin(this.ctx).register(this.ctx)
9494
}
95-
} catch (e: any) {
95+
} catch (e) {
9696
this.pluginMap.delete(name)
9797
this.list = this.list.filter((item: string) => item !== name)
9898
this.fullList.delete(name)
99-
this.ctx.log.error(e)
99+
this.ctx.log.error(e as Error)
100100
this.ctx.emit(IBuildInEvent.NOTIFICATION, {
101101
title: `Plugin ${name} Load Error`,
102102
body: e

yarn.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4839,7 +4839,7 @@ reusify@^1.0.4:
48394839
resolved "https://registry.yarnpkg.com/reusify/-/reusify-1.0.4.tgz#90da382b1e126efc02146e90845a88db12925d76"
48404840
integrity sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==
48414841

4842-
rimraf@^2.5.2, rimraf@^2.6.3:
4842+
rimraf@^2.5.2:
48434843
version "2.7.1"
48444844
resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-2.7.1.tgz#35797f13a7fdadc566142c29d4f07ccad483e3ec"
48454845
integrity sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w==

0 commit comments

Comments
 (0)