mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-05-13 05:12:55 -07:00
Remove redundant calls setting linuxClipboardTool. getUserLinuxClipboardTool() now handles the caching internally (#17320)
This commit is contained in:
@@ -163,10 +163,10 @@ async function checkXclipForImage() {
|
|||||||
*/
|
*/
|
||||||
export async function clipboardHasImage(): Promise<boolean> {
|
export async function clipboardHasImage(): Promise<boolean> {
|
||||||
if (process.platform === 'linux') {
|
if (process.platform === 'linux') {
|
||||||
linuxClipboardTool = getUserLinuxClipboardTool();
|
const tool = getUserLinuxClipboardTool();
|
||||||
if (linuxClipboardTool === 'wl-paste') {
|
if (tool === 'wl-paste') {
|
||||||
if (await checkWlPasteForImage()) return true;
|
if (await checkWlPasteForImage()) return true;
|
||||||
} else if (linuxClipboardTool === 'xclip') {
|
} else if (tool === 'xclip') {
|
||||||
if (await checkXclipForImage()) return true;
|
if (await checkXclipForImage()) return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
@@ -264,12 +264,13 @@ export async function saveClipboardImage(
|
|||||||
|
|
||||||
if (process.platform === 'linux') {
|
if (process.platform === 'linux') {
|
||||||
const tempFilePath = path.join(tempDir, `clipboard-${timestamp}.png`);
|
const tempFilePath = path.join(tempDir, `clipboard-${timestamp}.png`);
|
||||||
|
const tool = getUserLinuxClipboardTool();
|
||||||
|
|
||||||
if (linuxClipboardTool === 'wl-paste') {
|
if (tool === 'wl-paste') {
|
||||||
if (await saveFileWithWlPaste(tempFilePath)) return tempFilePath;
|
if (await saveFileWithWlPaste(tempFilePath)) return tempFilePath;
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
if (linuxClipboardTool === 'xclip') {
|
if (tool === 'xclip') {
|
||||||
if (await saveFileWithXclip(tempFilePath)) return tempFilePath;
|
if (await saveFileWithXclip(tempFilePath)) return tempFilePath;
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user