From c7363c76d04c8747ba8e84fe16824fe31b8bb39f Mon Sep 17 00:00:00 2001 From: Tsiry Sandratraina Date: Tue, 20 Aug 2024 12:49:36 +0000 Subject: [PATCH] add `community` command --- deno.lock | 10 ++++++++++ deps.ts | 1 + main.ts | 5 +++++ src/cmd/community.ts | 11 +++++++++++ 4 files changed, 27 insertions(+) create mode 100644 src/cmd/community.ts diff --git a/deno.lock b/deno.lock index 24a6885..b05e4e1 100644 --- a/deno.lock +++ b/deno.lock @@ -11,9 +11,16 @@ } } }, + "redirects": { + "https://deno.land/x/is_docker/mod.ts": "https://deno.land/x/is_docker@v2.0.0/mod.ts" + }, "remote": { "https://cdn.skypack.dev/-/lodash@v4.17.21-K6GEbP02mWFnLA45zAmi/dist=es2019,mode=imports/optimized/lodash.js": "10c4df47937ffc78548d136dd535a021df5f57182a653260d715c0690dd22978", "https://cdn.skypack.dev/lodash": "8280de0b3efd87f06ea0eb330d15b8de32c059556023b8c6524e9eb9e4844dc0", + "https://deno.land/std@0.106.0/path/_constants.ts": "1247fee4a79b70c89f23499691ef169b41b6ccf01887a0abd131009c5581b853", + "https://deno.land/std@0.106.0/path/_interface.ts": "1fa73b02aaa24867e481a48492b44f2598cd9dfa513c7b34001437007d3642e4", + "https://deno.land/std@0.106.0/path/_util.ts": "2e06a3b9e79beaf62687196bd4b60a4c391d862cfa007a20fc3a39f778ba073b", + "https://deno.land/std@0.106.0/path/posix.ts": "b81974c768d298f8dcd2c720229639b3803ca4a241fa9a355c762fa2bc5ef0c1", "https://deno.land/std@0.133.0/_deno_unstable.ts": "23a1a36928f1b6d3b0170aaa67de09af12aa998525f608ff7331b9fb364cbde6", "https://deno.land/std@0.133.0/_util/assert.ts": "e94f2eb37cebd7f199952e242c77654e43333c1ac4c5c700e929ea3aa5489f74", "https://deno.land/std@0.133.0/_util/os.ts": "49b92edea1e82ba295ec946de8ffd956ed123e2948d9bd1d3e901b04e4307617", @@ -213,6 +220,8 @@ "https://deno.land/x/docker_names@v1.1.0/mod.ts": "196aefa58be04be1e7c6e9cba1d48db77534d1c7e0c74cb044cb9414932f68ef", "https://deno.land/x/docker_names@v1.1.0/personalities.ts": "20c5a965cee41929bf2f019cba6d460530d6346f7d9ee8de829e6e9e600d00df", "https://deno.land/x/docker_names@v1.1.0/rand.ts": "1418683fa1af75aecb3df55aa34d24cc0828f01cd9bf4a28539fefc85d36ceea", + "https://deno.land/x/is_docker@v2.0.0/mod.ts": "4c8753346f4afbb6c251d7984a609aa84055559cf713fba828939a5d39c95cd0", + "https://deno.land/x/is_wsl@v1.1.0/mod.ts": "30996b09376652df7a4d495320e918154906ab94325745c1399e13e658dca5da", "https://deno.land/x/logger@v1.1.3/date.ts": "09041dc83c9cddb489b875f45b07336dd894c23b9dd5b47235b94180571a2efa", "https://deno.land/x/logger@v1.1.3/deps.ts": "1b09212250f8023edd69efb798874ca19bf90c4ed7cdcc1a292dc16c5bb2cf6d", "https://deno.land/x/logger@v1.1.3/eol.ts": "493acd048c546fd48bcd26365d4dadf3db81ce32c4611ca5b0b19e6de9f9826a", @@ -223,6 +232,7 @@ "https://deno.land/x/logger@v1.1.3/types.ts": "8835d0d56f500112f92b36d8f241f95bccef93f73de203f7cd86de3ab4383d80", "https://deno.land/x/logger@v1.1.3/writable.ts": "bb60ba4a798a10ac1649e30598c0c346055c0dcacb8f1e9452e4f66ea6680a45", "https://deno.land/x/logger@v1.1.3/writer.ts": "539ff3a1bdefef897ca1d13d387ee4d84d6491f460020454e9158076f5e09221", + "https://deno.land/x/open@v0.0.6/index.ts": "c7484a7bf2628236f33bbe354520e651811faf1a7cbc3c3f80958ce81b4c42ef", "https://deno.land/x/spinners@v1.1.2/mod.ts": "ed5b3562d4ea6c6887bc7e9844612b08a3bc3a3678ca77cc7dfdf461c362751e", "https://deno.land/x/spinners@v1.1.2/spinner-types.ts": "c67e6962a0c738aa57b4d3ad9fe06c8c0131f93360acbf95456f2ba200fd8826", "https://deno.land/x/spinners@v1.1.2/terminal-spinner.ts": "1cf0c38a423781734e2e538323c1992027830d741e90f0b81f532e5bc993d035", diff --git a/deps.ts b/deps.ts index b3a603e..b62e844 100644 --- a/deps.ts +++ b/deps.ts @@ -40,3 +40,4 @@ export { export { generateName } from "https://deno.land/x/docker_names@v1.1.0/mod.ts "; import * as _ from "https://cdn.skypack.dev/lodash"; export { _ }; +export { open } from "https://deno.land/x/open@v0.0.6/index.ts"; diff --git a/main.ts b/main.ts index 75a7fbf..a34e22b 100644 --- a/main.ts +++ b/main.ts @@ -1,4 +1,5 @@ import { Command, brightGreen } from "./deps.ts"; +import community from "./src/cmd/community.ts"; import down from "./src/cmd/down.ts"; import init from "./src/cmd/init.ts"; import list from "./src/cmd/list.ts"; @@ -67,6 +68,10 @@ async function main() { .action(async function () { await list(); }) + .command("community", "Join our community Discord to chat with us") + .action(async function () { + await community(); + }) .parse(Deno.args); } diff --git a/src/cmd/community.ts b/src/cmd/community.ts new file mode 100644 index 0000000..2d80173 --- /dev/null +++ b/src/cmd/community.ts @@ -0,0 +1,11 @@ +import { open } from "../../deps.ts"; + +export default function community() { + const DISCORD_INVITE = "https://discord.gg/RxKa62YAs4"; + console.log(DISCORD_INVITE); + + open(DISCORD_INVITE).catch((err) => { + console.error(err); + Deno.exit(1); + }); +}