Revert "feat(ui): redesign menu and add explain, review, changelog, suggest commands"
Build / bun-build (push) Has been cancelled
Build / bun-build (push) Has been cancelled
This reverts commit 1e370be8af.
This commit is contained in:
+21
-21
@@ -1,26 +1,26 @@
|
||||
export async function copyToClipboard(text: string): Promise<boolean> {
|
||||
const commands: string[][] = [];
|
||||
const commands: string[][] = [];
|
||||
|
||||
if (process.platform === "darwin") {
|
||||
commands.push(["pbcopy"]);
|
||||
} else if (process.platform === "linux") {
|
||||
commands.push(["xclip", "-selection", "clipboard"]);
|
||||
commands.push(["xsel", "--clipboard", "--input"]);
|
||||
}
|
||||
if (process.platform === "darwin") {
|
||||
commands.push(["pbcopy"]);
|
||||
} else if (process.platform === "linux") {
|
||||
commands.push(["xclip", "-selection", "clipboard"]);
|
||||
commands.push(["xsel", "--clipboard", "--input"]);
|
||||
}
|
||||
|
||||
for (const cmd of commands) {
|
||||
try {
|
||||
const proc = Bun.spawn(cmd, {
|
||||
stdin: "pipe",
|
||||
stdout: "ignore",
|
||||
stderr: "ignore",
|
||||
});
|
||||
proc.stdin.write(text);
|
||||
proc.stdin.end();
|
||||
const exitCode = await proc.exited;
|
||||
if (exitCode === 0) return true;
|
||||
} catch {}
|
||||
}
|
||||
for (const cmd of commands) {
|
||||
try {
|
||||
const proc = Bun.spawn(cmd, {
|
||||
stdin: "pipe",
|
||||
stdout: "ignore",
|
||||
stderr: "ignore",
|
||||
});
|
||||
proc.stdin.write(text);
|
||||
proc.stdin.end();
|
||||
const exitCode = await proc.exited;
|
||||
if (exitCode === 0) return true;
|
||||
} catch {}
|
||||
}
|
||||
|
||||
return false;
|
||||
return false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user