mirror of
https://github.com/Kuingsmile/PicList.git
synced 2026-05-23 09:12:57 +08:00
Added: clipboard image handler for picgo-core
This commit is contained in:
@@ -5,6 +5,13 @@ import path from 'path'
|
||||
import fs from 'fs-extra'
|
||||
import { remote, app } from 'electron'
|
||||
|
||||
if (process.env.NODE_ENV !== 'development') {
|
||||
global.__static = path.join(__dirname, '/static').replace(/\\/g, '\\\\')
|
||||
}
|
||||
if (process.env.DEBUG_ENV === 'debug') {
|
||||
global.__static = path.join(__dirname, '../../static').replace(/\\/g, '\\\\')
|
||||
}
|
||||
|
||||
const APP = process.type === 'renderer' ? remote.app : app
|
||||
const STORE_PATH = APP.getPath('userData')
|
||||
|
||||
@@ -35,4 +42,11 @@ if (!db.has('settings.shortKey').value()) {
|
||||
}).write()
|
||||
}
|
||||
|
||||
// init generate clipboard image files
|
||||
if (!fs.pathExistsSync(path.join(STORE_PATH, 'windows.ps1'))) {
|
||||
fs.copySync(path.join(__static, '/linux.sh'), path.join(STORE_PATH, '/linux.sh'))
|
||||
fs.copySync(path.join(__static, '/mac.applescript'), path.join(STORE_PATH, '/mac.applescript'))
|
||||
fs.copySync(path.join(__static, '/windows.ps1'), path.join(STORE_PATH, '/windows.ps1'))
|
||||
}
|
||||
|
||||
export default db
|
||||
|
||||
Reference in New Issue
Block a user