From 500a0c0274b66228d846eb782dd43463c5e5b8c6 Mon Sep 17 00:00:00 2001 From: Kid <44045911+kidonng@users.noreply.github.com> Date: Fri, 24 Sep 2021 03:30:44 +0800 Subject: [PATCH] Use `/usr/bin/env bash` instead of `/bin/bash` for GitHub CLI extensions shebang (#9962) --- .../github-cli/github-cli/creating-github-cli-extensions.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/content/github-cli/github-cli/creating-github-cli-extensions.md b/content/github-cli/github-cli/creating-github-cli-extensions.md index 6c3cb4783f..517999778c 100644 --- a/content/github-cli/github-cli/creating-github-cli-extensions.md +++ b/content/github-cli/github-cli/creating-github-cli-extensions.md @@ -48,7 +48,7 @@ You can use the `gh extension create` command to create a project for your exten 1. Write your script in the executable file. For example: ```bash - #!/bin/bash + #!/usr/bin/env bash set -e exec gh api user --jq '"You are @\(.login) (\(.name))."' ``` @@ -84,7 +84,7 @@ All command line arguments following a `gh my-extension-name` command will be pa For example, this script handles multiple flags. When the script is called with the `-h` or `--help` flag, the script prints help text instead of continuing execution. When the script is called with the `--name` flag, the script sets the next value after the flag to `name_arg`. When the script is called with the `--verbose` flag, the script prints a different greeting. ```bash -#!/bin/bash +#!/usr/bin/env bash set -e verbose="" @@ -149,4 +149,4 @@ For more information, see [`gh help formatting`](https://cli.github.com/manual/g ## Next steps -To see more examples of {% data variables.product.prodname_cli %} extensions, look at [repositories with the `gh-extension` topic](https://github.com/topics/gh-extension). \ No newline at end of file +To see more examples of {% data variables.product.prodname_cli %} extensions, look at [repositories with the `gh-extension` topic](https://github.com/topics/gh-extension).