piclist 1.6.8 → 1.7.0
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/bin/picgo +3 -0
- package/bin/picgo-server +5 -0
- package/dist/index.cjs.js +2 -2
- package/dist/index.esm.js +2 -2
- package/package.json +1 -1
package/bin/picgo
CHANGED
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
const path = require('path')
|
|
3
3
|
const minimist = require('minimist')
|
|
4
|
+
const os = require('os')
|
|
5
|
+
|
|
4
6
|
const argv = minimist(process.argv.slice(2))
|
|
5
7
|
let configPath = argv.c || argv.config || ''
|
|
6
8
|
if (configPath !== true && configPath !== '') {
|
|
9
|
+
configPath = configPath.replace(/^~/, os.homedir())
|
|
7
10
|
configPath = path.resolve(configPath)
|
|
8
11
|
} else {
|
|
9
12
|
configPath = ''
|
package/bin/picgo-server
CHANGED
|
@@ -129,6 +129,11 @@ const multerStorage = multer.diskStorage({
|
|
|
129
129
|
cb(null, tempDir)
|
|
130
130
|
},
|
|
131
131
|
filename: function (_req, file, cb) {
|
|
132
|
+
if (!/[^\u0000-\u00ff]/.test(file.originalname)) {
|
|
133
|
+
file.originalname = Buffer.from(file.originalname, 'latin1').toString(
|
|
134
|
+
'utf8'
|
|
135
|
+
)
|
|
136
|
+
}
|
|
132
137
|
cb(null, file.originalname)
|
|
133
138
|
}
|
|
134
139
|
})
|