Skip to content

Commit

Permalink
🐛 Fix(custom): remove unused code
Browse files Browse the repository at this point in the history
  • Loading branch information
Kuingsmile committed Jun 17, 2024
1 parent 869573d commit ef137fe
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 16 deletions.
3 changes: 0 additions & 3 deletions src/utils/db.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,3 @@ class DB {
}

export default DB

const s = '123'
1 + 2 + s
1 change: 1 addition & 0 deletions src/utils/eventBus.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { EventEmitter } from 'events'

const eventBus = new EventEmitter()

export { eventBus }
21 changes: 8 additions & 13 deletions src/utils/getClipboardImage.ts
Original file line number Diff line number Diff line change
@@ -1,32 +1,26 @@
import path from 'path'
import { spawn } from 'child_process'
import dayjs from 'dayjs'
import os from 'os'
import fs, { ensureDirSync } from 'fs-extra'
import isWsl from 'is-wsl'
import { IPicGo, IClipboardImage } from '../types'
import { IBuildInEvent } from './enum'
import path from 'path'
import os from 'os'

import macClipboardScript from './clipboard/mac.applescript'
import windowsClipboardScript from './clipboard/windows.ps1'
import windows10ClipboardScript from './clipboard/windows10.ps1'
import linuxClipboardScript from './clipboard/linux.sh'
import wslClipboardScript from './clipboard/wsl.sh'
import { IBuildInEvent } from './enum'
import { IPicGo, IClipboardImage } from '../types'
import { CLIPBOARD_IMAGE_FOLDER } from './static'

export type Platform = 'darwin' | 'win32' | 'win10' | 'linux' | 'wsl'

const getCurrentPlatform = (): Platform => {
const platform = process.platform
if (isWsl) {
return 'wsl'
}
if (isWsl) return 'wsl'
if (platform === 'win32') {
const currentOS = os.release().split('.')[0]
if (currentOS === '10') {
return 'win10'
} else {
return 'win32'
}
return os.release().split('.')[0] === '10' ? 'win10' : 'win32'
} else if (platform === 'darwin') {
return 'darwin'
} else {
Expand All @@ -43,6 +37,7 @@ const platform2ScriptContent: {
linux: linuxClipboardScript,
wsl: wslClipboardScript
}

/**
* powershell will report error if file does not have a '.ps1' extension,
* so we should keep the extension name consistent with corresponding shell
Expand Down

0 comments on commit ef137fe

Please sign in to comment.