feat: scaffold Astro + Tailwind project
This commit is contained in:
32
node_modules/astro/dist/cli/info/infra/tinyclip-clipboard.js
generated
vendored
Normal file
32
node_modules/astro/dist/cli/info/infra/tinyclip-clipboard.js
generated
vendored
Normal file
@@ -0,0 +1,32 @@
|
||||
import { writeText } from "tinyclip";
|
||||
class TinyclipClipboard {
|
||||
#logger;
|
||||
#prompt;
|
||||
constructor({
|
||||
logger,
|
||||
prompt
|
||||
}) {
|
||||
this.#logger = logger;
|
||||
this.#prompt = prompt;
|
||||
}
|
||||
async copy(text) {
|
||||
if (!await this.#prompt.confirm({
|
||||
message: "Copy to clipboard?",
|
||||
defaultValue: true
|
||||
})) {
|
||||
return;
|
||||
}
|
||||
try {
|
||||
await writeText(text.trim());
|
||||
this.#logger.info("SKIP_FORMAT", "Copied to clipboard!");
|
||||
} catch {
|
||||
this.#logger.error(
|
||||
"SKIP_FORMAT",
|
||||
"Sorry, something went wrong! Please copy the text above manually."
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
export {
|
||||
TinyclipClipboard
|
||||
};
|
||||
Reference in New Issue
Block a user