Skip to content

Commit 6e4c488

Browse files
committed
✨ Feature: add millisecond for file name
1 parent bde7223 commit 6e4c488

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

.vscode/settings.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
"typescriptreact"
99
],
1010
"editor.codeActionsOnSave": {
11-
"source.fixAll.eslint": true
11+
"source.fixAll.eslint": "explicit"
1212
},
1313
"eslint.enable": true,
1414
"eslint.alwaysShowStatus": true,

src/plugins/transformer/path.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ const handle = async (ctx: IPicGo): Promise<IPicGo> => {
2828
const extname = info.extname || imgSize.extname || '.png'
2929
results[index] = {
3030
buffer: info.buffer,
31-
fileName: info.fileName || `${dayjs().format('YYYYMMDDHHmmss')}${extname}}`,
31+
fileName: info.fileName || `${dayjs().format('YYYYMMDDHHmmssSSS')}${extname}}`,
3232
width: imgSize.width,
3333
height: imgSize.height,
3434
extname

src/utils/getClipboardImage.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ function createImageFolder (ctx: IPicGo): void {
6868
const getClipboardImage = async (ctx: IPicGo): Promise<IClipboardImage> => {
6969
createImageFolder(ctx)
7070
// add an clipboard image folder to control the image cache file
71-
const imagePath = path.join(ctx.baseDir, CLIPBOARD_IMAGE_FOLDER, `${dayjs().format('YYYYMMDDHHmmss')}.png`)
71+
const imagePath = path.join(ctx.baseDir, CLIPBOARD_IMAGE_FOLDER, `${dayjs().format('YYYYMMDDHHmmssSSS')}.png`)
7272
return await new Promise<IClipboardImage>((resolve: Function, reject: Function): void => {
7373
const platform = getCurrentPlatform()
7474
const scriptPath = path.join(ctx.baseDir, platform2ScriptFilename[platform])

0 commit comments

Comments
 (0)