Skip to content

Commit

Permalink
🐛 Fix: build error in windows
Browse files Browse the repository at this point in the history
  • Loading branch information
Molunerfinn committed Dec 27, 2021
1 parent f2f5ba6 commit 5616fb9
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"start": "node ./bin/picgo",
"lint": "eslint src/**/*.ts && npm run build",
"test": "echo \"Error: no test specified\" && exit 1",
"build": "rm -rf ./dist && rollup -c rollup.config.js && ls -lh dist",
"build": "rimraf ./dist && rollup -c rollup.config.js",
"dev": "rollup -c rollup.config.js -w",
"patch": "npm version patch && git push origin master && git push origin --tags",
"minor": "npm version minor && git push origin master && git push origin --tags",
Expand Down Expand Up @@ -115,7 +115,7 @@
"request": "^2.87.0",
"request-promise-native": "^1.0.5",
"resolve": "^1.8.1",
"rimraf": "^2.6.3"
"rimraf": "^3.0.2"
},
"repository": {
"type": "git",
Expand Down
4 changes: 2 additions & 2 deletions src/lib/Logger.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,12 @@ export class Logger implements ILogger {
let log = `${dayjs().format('YYYY-MM-DD HH:mm:ss')} [PicGo ${type.toUpperCase()}] `
msg.forEach((item: ILogArgvTypeWithError) => {
if (typeof item === 'object' && type === 'error') {
log += `\n------Error Stack Begin------\n${util.format(item.stack)}\n-------Error Stack End------- `
log += `\n------Error Stack Begin------\n${util.format(item?.stack)}\n-------Error Stack End------- `
} else {
if (typeof item === 'object') {
item = JSON.stringify(item)
}
log += `${item} `
log += `${item as string} `
}
})
log += '\n'
Expand Down
4 changes: 2 additions & 2 deletions src/lib/PluginHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -229,8 +229,8 @@ export class PluginHandler implements IPluginHandler {
this.ctx.log.error('NPM is not installed')
this.ctx.emit(IBuildInEvent.FAILED, 'NPM is not installed')
})
} catch (e: any) {
this.ctx.log.error(e)
} catch (e) {
this.ctx.log.error(e as Error)
this.ctx.emit(IBuildInEvent.FAILED, e)
}
})
Expand Down
4 changes: 2 additions & 2 deletions src/lib/PluginLoader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,11 +92,11 @@ export class PluginLoader implements IPluginLoader {
this.pluginMap.set(name, pluginInterface)
plugin(this.ctx).register(this.ctx)
}
} catch (e: any) {
} catch (e) {
this.pluginMap.delete(name)
this.list = this.list.filter((item: string) => item !== name)
this.fullList.delete(name)
this.ctx.log.error(e)
this.ctx.log.error(e as Error)
this.ctx.emit(IBuildInEvent.NOTIFICATION, {
title: `Plugin ${name} Load Error`,
body: e
Expand Down
2 changes: 1 addition & 1 deletion yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4839,7 +4839,7 @@ reusify@^1.0.4:
resolved "https://registry.yarnpkg.com/reusify/-/reusify-1.0.4.tgz#90da382b1e126efc02146e90845a88db12925d76"
integrity sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==

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

0 comments on commit 5616fb9

Please sign in to comment.