mirror of
https://github.com/Kuingsmile/PicList.git
synced 2026-05-16 23:07:37 +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
|
||||
|
||||
@@ -84,8 +84,9 @@ class Uploader {
|
||||
upload () {
|
||||
const win = BrowserWindow.fromWebContents(this.webContents)
|
||||
const picgo = new PicGo(CONFIG_PATH)
|
||||
console.log(picgo.pluginLoader.getList())
|
||||
picgo.config.debug = true
|
||||
// for picgo-core
|
||||
picgo.config.PICGO_ENV = 'GUI'
|
||||
let input = this.img
|
||||
|
||||
picgo.helper.beforeUploadPlugins.register('renameFn', {
|
||||
|
||||
Reference in New Issue
Block a user