Skip to content

Commit

Permalink
chore: update copy to clipboard
Browse files Browse the repository at this point in the history
  • Loading branch information
zdm committed Dec 22, 2024
1 parent 46d2676 commit e811eb4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
6 changes: 2 additions & 4 deletions lib/commands/generate/keys.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import childProcess from "node:child_process";
import crypto from "node:crypto";
import { copyToClipboard } from "#core/utils";
import Command from "#lib/command";

export default class extends Command {
Expand Down Expand Up @@ -74,9 +74,7 @@ export default class extends Command {
console.log( privateKey );

if ( process.cli.options.copy && process.platform === "win32" ) {
childProcess.spawnSync( "clip", {
"input": privateKey,
} );
copyToClipboard( privateKey );

console.log( "Private key copied to the clipboard" );
}
Expand Down
6 changes: 2 additions & 4 deletions lib/commands/generate/telegram-session.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import childProcess from "node:child_process";
import TelegramClient from "#core/api/telegram/client";
import { copyToClipboard } from "#core/utils";
import Command from "#lib/command";

export default class extends Command {
Expand Down Expand Up @@ -72,9 +72,7 @@ ${ session }
` );

if ( process.cli.options.copy && process.platform === "win32" ) {
childProcess.spawnSync( "clip", {
"input": session,
} );
copyToClipboard( session );

console.log( "Session copied to the clipboard" );
}
Expand Down

0 comments on commit e811eb4

Please sign in to comment.