Skip to content

Commit

Permalink
Merge pull request #1059 from polyseam/tel-success
Browse files Browse the repository at this point in the history
[Enhancement]: `--welcome` new users!
  • Loading branch information
johnstonmatt authored Nov 2, 2024
2 parents 076c467 + 9fcaec0 commit bd1692f
Show file tree
Hide file tree
Showing 9 changed files with 26 additions and 19 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/bin-build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
- name: Setup Deno
uses: denoland/setup-deno@v2
with:
deno-version: "v2.0.3"
deno-version: "v2.0.4"
- name: deno build-linux
run: deno task build-linux
- name: linux cndi --help
Expand All @@ -28,7 +28,7 @@ jobs:
- name: Setup Deno
uses: denoland/setup-deno@v2
with:
deno-version: "v2.0.3"
deno-version: "v2.0.4"
- name: deno build-mac
run: deno task build-mac
- name: mac cndi --help
Expand All @@ -41,7 +41,7 @@ jobs:
- name: Setup Deno
uses: denoland/setup-deno@v2
with:
deno-version: "v2.0.3"
deno-version: "v2.0.4"
- name: deno build-win
run: deno task build-win
- name: win cndi --help
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/gh-release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
- name: Deno
uses: denoland/setup-deno@v2
with:
deno-version: "v2.0.3"
deno-version: "v2.0.4"

- name: Checkout
uses: actions/checkout@v3
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/main-latest.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
- name: use deno
uses: denoland/setup-deno@v2
with:
deno-version: v2.0.3
deno-version: v2.0.4

- run: deno lint

Expand All @@ -31,7 +31,7 @@ jobs:
- name: use deno
uses: denoland/setup-deno@v2
with:
deno-version: v2.0.3
deno-version: v2.0.4

- run: deno task build

Expand Down
4 changes: 2 additions & 2 deletions deno.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"version": "2.21.1",
"deno_version": "2.0.3",
"version": "2.22.0",
"deno_version": "2.0.4",
"tasks": {
"tar-win": "tar -czvf dist/release-archives/cndi-win.tar.gz -C dist/win/in .",
"tar-linux": "tar -czvf dist/release-archives/cndi-linux.tar.gz -C dist/linux/in .",
Expand Down
2 changes: 1 addition & 1 deletion install.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ if (!(";${Path};".ToLower() -like "*;${BinDir};*".ToLower())) {
$Env:Path += ";${BinDir}"
}

& $CNDIExe '--help'
& $CNDIExe '--help' '--welcome'

Write-Output "CNDI was installed successfully to ${CNDIExe}"
Write-Output "Stuck? Join our Discord https://cndi.run/di?utm_id=5095"
6 changes: 2 additions & 4 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ main() {
if [ "$shell_profile" = ".zshrc" ]; then
echo "finalizing installation..."
# running 'cndi --help' will save the user wait time on first run
$exe --help
$exe --help --welcome
echo
echo "cndi was installed successfully! Please restart your terminal."
echo "Need some help? Join our Discord https://cndi.run/di?utm_id=5096"
Expand All @@ -84,15 +84,13 @@ main() {
. "$HOME/$shell_profile"
echo "finalizing installation..."
# running 'cndi --help' will save the user wait time on first run
$exe --help
$exe --help --welcome
echo
echo "cndi was installed successfully! Please restart your terminal."
echo "Need some help? Join our Discord https://cndi.run/di?utm_id=5096"
echo
exit 0
fi


}

main "$@"
18 changes: 14 additions & 4 deletions src/cndi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import {
Command,
CompletionsCommand,
ensureDirSync,
HelpCommand,
homedir,
path,
} from "deps";
Expand All @@ -22,7 +21,7 @@ import destroyCommand from "src/commands/destroy.ts";
import installCommand from "src/commands/install.ts";
import showOutputsCommand from "src/commands/show-outputs.ts";

import { removeOldBinaryIfRequired } from "src/utils.ts";
import { emitExitEvent, removeOldBinaryIfRequired } from "src/utils.ts";

const label = ccolors.faded("\nsrc/cndi.ts:");

Expand Down Expand Up @@ -77,15 +76,26 @@ export default async function cndi() {
.description("Cloud-Native Data Infrastructure")
.meta("kubeseal", `v${KUBESEAL_VERSION}`)
.meta("terraform", `v${TERRAFORM_VERSION}`)
.globalOption("--welcome", "a new user has arrived!", {
hidden: true,
})
.command("create", createCommand)
.command("init", initCommand)
.command("overwrite", overwriteCommand)
.command("run", runCommand)
.command("destroy", destroyCommand)
.command("upgrade", upgradeCommand)
.command("install", installCommand)
.command("install", installCommand) // backwards compatibility noop
.command("show-outputs", showOutputsCommand)
.command("completions", new CompletionsCommand().global())
.command("help", new HelpCommand().global())
.helpOption("-h, --help", "Show this help.", {
action: async function (this) {
this.showHelp();
await emitExitEvent(0);
Deno.exit(0);
},
standalone: false,
global: true,
})
.parse(Deno.args);
}
2 changes: 1 addition & 1 deletion src/commands/create.ts
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ const echoCreate = (options: EchoCreateOptions, slug?: string) => {
* --label <provider-distribution-slug> to specify the label
*/
const createCommand = new Command()
.description("Create a new CNDI project.")
.description(`Create a new cndi project.`)
.arguments("[owner/repo-slug:string]")
.option(
"-t, --template <template:string>",
Expand Down
1 change: 0 additions & 1 deletion src/deps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ export const YAML = {
// - cliffy
export { Command } from "@cliffy/command";
export { CompletionsCommand } from "@cliffy/command/completions";
export { HelpCommand } from "@cliffy/command/help";

import { colors } from "@cliffy/ansi/colors";

Expand Down

0 comments on commit bd1692f

Please sign in to comment.