├── .github ├── auto_assign.yaml ├── renovate.json └── workflows │ ├── pull-request.yaml │ └── workflow.yaml ├── LICENSE ├── README.md └── bin ├── download ├── install ├── list-all └── uninstall /.github/auto_assign.yaml: -------------------------------------------------------------------------------- 1 | # Set to true to add reviewers to pull requests 2 | addReviewers: true 3 | 4 | # Set to true to add assignees to pull requests 5 | addAssignees: author 6 | 7 | # A list of reviewers to be added to pull requests (GitHub user name) 8 | reviewers: 9 | - grimoh 10 | 11 | # A number of reviewers added to the pull request 12 | # Set 0 to add all the reviewers (default: 0) 13 | numberOfReviewers: 0 14 | # A list of assignees, overrides reviewers if set 15 | # assignees: 16 | # - assigneeA 17 | 18 | # A number of assignees to add to the pull request 19 | # Set to 0 to add all of the assignees. 20 | # Uses numberOfReviewers if unset. 21 | # numberOfAssignees: 2 22 | 23 | # A list of keywords to be skipped the process that add reviewers if pull requests include it 24 | # skipKeywords: 25 | # - wip 26 | -------------------------------------------------------------------------------- /.github/renovate.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://docs.renovatebot.com/renovate-schema.json", 3 | "extends": [ 4 | "config:base" 5 | ] 6 | } 7 | -------------------------------------------------------------------------------- /.github/workflows/pull-request.yaml: -------------------------------------------------------------------------------- 1 | name: Auto assign 2 | 3 | on: 4 | pull_request: 5 | 6 | jobs: 7 | add-reviews: 8 | runs-on: ubuntu-latest 9 | steps: 10 | - uses: kentaro-m/auto-assign-action@f4648c0a9fdb753479e9e75fc251f507ce17bb7e # v2.0.0 11 | with: 12 | configuration-path: '.github/auto_assign.yaml' 13 | -------------------------------------------------------------------------------- /.github/workflows/workflow.yaml: -------------------------------------------------------------------------------- 1 | name: Main workflow 2 | 3 | on: 4 | push: 5 | paths-ignore: 6 | - '**.md' 7 | pull_request: 8 | paths-ignore: 9 | - '**.md' 10 | schedule: 11 | - cron: "0 0 * * 5" 12 | 13 | jobs: 14 | build: 15 | strategy: 16 | matrix: 17 | os: [ubuntu-latest, macOS-latest] 18 | 19 | runs-on: ${{ matrix.os }} 20 | 21 | steps: 22 | - name: asdf plugin test 23 | uses: asdf-vm/actions/plugin-test@05e0d2ed97b598bfce82fd30daf324ae0c4570e6 # v3.0.2 24 | with: 25 | command: starship --version 26 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2024 gr1m0h 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | [![GitHub Actions Status](https://github.com/gr1m0h/asdf-starship/workflows/Main%20workflow/badge.svg?branch=main)](https://github.com/gr1m0h/asdf-starship/actions) 2 | 3 | # asdf-starship 4 | 5 | [Starship](https://github.com/starship/starship) plugin for [asdf](https://github.com/asdf-vm/asdf) version manager 6 | 7 | ## Installation 8 | 9 | Install the plugin: 10 | 11 | ``` 12 | asdf plugin add starship 13 | ``` 14 | 15 | Add the init script to your shell's config file: 16 | * For more details: [Starship Installation](https://starship.rs/guide/#%F0%9F%9A%80-installation) 17 | -------------------------------------------------------------------------------- /bin/download: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | set -e 3 | 4 | # check ASDF environment variables 5 | [ -n "$ASDF_INSTALL_VERSION" ] || (echo 'Missing ASDF_INSTALL_VERSION' >&2 && exit 1) 6 | [ -n "$ASDF_DOWNLOAD_PATH" ] || (echo 'Missing ASDF_DOWNLOAD_PATH' >&2 && exit 1) 7 | 8 | case "$(uname -s)" in 9 | "Darwin") 10 | case "$(uname -m)" in 11 | "arm64") 12 | DOWNLOAD_URL="https://github.com/starship/starship/releases/download/v${ASDF_INSTALL_VERSION}/starship-aarch64-apple-darwin.tar.gz" 13 | ;; 14 | "x86_64") 15 | DOWNLOAD_URL="https://github.com/starship/starship/releases/download/v${ASDF_INSTALL_VERSION}/starship-x86_64-apple-darwin.tar.gz" 16 | ;; 17 | esac 18 | ;; 19 | "Linux") 20 | case "$(uname -m)" in 21 | "armv7l") 22 | DOWNLOAD_URL="https://github.com/starship/starship/releases/download/v${ASDF_INSTALL_VERSION}/starship-arm-unknown-linux-musleabihf.tar.gz" 23 | ;; 24 | "x86_64") 25 | DOWNLOAD_URL="https://github.com/starship/starship/releases/download/v${ASDF_INSTALL_VERSION}/starship-x86_64-unknown-linux-musl.tar.gz" 26 | ;; 27 | "aarch64") 28 | DOWNLOAD_URL="https://github.com/starship/starship/releases/download/v${ASDF_INSTALL_VERSION}/starship-aarch64-unknown-linux-musl.tar.gz" 29 | ;; 30 | esac 31 | ;; 32 | esac 33 | 34 | curl -fL -o "${ASDF_DOWNLOAD_PATH}/starship.tar.gz" "${DOWNLOAD_URL}" 35 | -------------------------------------------------------------------------------- /bin/install: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | set -e 3 | 4 | # check ASDF environment variables 5 | [ -n "$ASDF_INSTALL_PATH" ] || (echo 'Missing ASDF_INSTALL_PATH' >&2 && exit 1) 6 | [ -n "$ASDF_DOWNLOAD_PATH" ] || (echo 'Missing ASDF_DOWNLOAD_PATH' >&2 && exit 1) 7 | 8 | mkdir -p "${ASDF_INSTALL_PATH}/bin" 9 | toolPath="${ASDF_INSTALL_PATH}/bin/starship" 10 | 11 | cd "${ASDF_DOWNLOAD_PATH}" 12 | tar xzf starship.tar.gz 13 | mv ./starship "${toolPath}" 14 | chmod +x "${toolPath}" 15 | -------------------------------------------------------------------------------- /bin/list-all: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | set -e 3 | 4 | release_path="https://api.github.com/repos/starship/starship/releases" 5 | cmd="curl -s" 6 | if [ -n "$GITHUB_API_TOKEN" ]; then 7 | cmd="$cmd -H 'Authorization: token $GITHUB_API_TOKEN'" 8 | fi 9 | cmd="$cmd $release_path" 10 | 11 | versions=$(eval $cmd | sed -nE 's/^ "tag_name": "v(.+)",$/\1/pg' | sed -n -e '1!G;h;$p') 12 | echo $versions 13 | -------------------------------------------------------------------------------- /bin/uninstall: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | set -e 3 | 4 | # check ASDF environment variables 5 | [ -n "$ASDF_INSTALL_PATH" ] || (echo 'Missing ASDF_INSTALL_PATH' >&2 && exit 1) 6 | 7 | # uninstall 8 | rm -rf "${ASDF_INSTALL_PATH}" 9 | --------------------------------------------------------------------------------