sys-shim 0.0.1-8 → 0.0.1-9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
package/readme.md
CHANGED
@@ -58,14 +58,17 @@ async function getIcon(iconPath) {
|
|
58
58
|
if(fs.existsSync(iconPath)) {
|
59
59
|
return iconPath
|
60
60
|
} else {
|
61
|
+
let icon
|
61
62
|
try {
|
62
63
|
const res = new url.URL(iconPath)
|
63
|
-
|
64
|
+
icon = `${res.protocol}//${res.host}/favicon.ico`
|
64
65
|
const tempIcon = `${os.tmpdir()}/${filenamify(icon)}`
|
65
66
|
fs.writeFileSync(tempIcon, await download(icon))
|
66
67
|
return tempIcon
|
67
68
|
} catch (error) {
|
68
|
-
console.warn(`从 ${
|
69
|
+
console.warn(`从 ${icon} 获取图标错误:`)
|
70
|
+
console.warn(String(error))
|
71
|
+
console.warn(`将使用默认图标`)
|
69
72
|
return `${pkgDir}/script/npm-pkg/shim/win/favicon.ico`
|
70
73
|
}
|
71
74
|
}
|
Binary file
|
Binary file
|