Skip to content

Commit

Permalink
Merge branch 'master' into help-all-subcommands
Browse files Browse the repository at this point in the history
  • Loading branch information
hyperupcall committed Sep 17, 2023
2 parents 7df5a5f + b45f1dc commit 498cce2
Show file tree
Hide file tree
Showing 28 changed files with 781 additions and 357 deletions.
4 changes: 4 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,7 @@ updates:
interval: "monthly"
reviewers:
- "jthegedus"
groups:
docs:
patterns:
- "*"
4 changes: 2 additions & 2 deletions .github/workflows/documentation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
working-directory: docs/

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
# fetch all commits to get last updated time or other git log info
fetch-depth: 0
Expand Down Expand Up @@ -49,7 +49,7 @@ jobs:
run: cp CNAME .vitepress/dist

- name: Deploy to GitHub Pages
uses: crazy-max/ghaction-github-pages@v3
uses: crazy-max/ghaction-github-pages@v4
with:
# deploy to gh-pages branch
target_branch: gh-pages
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
asdf:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: asdf-vm/actions/install@v2
- uses: actions/setup-python@v4
with:
Expand All @@ -24,7 +24,7 @@ jobs:
actions:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Check workflow files
uses: docker://rhysd/actionlint:1.6.24
with:
Expand Down
2 changes: 0 additions & 2 deletions .github/workflows/semantic-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,3 @@ jobs:
- uses: amannn/action-semantic-pull-request@v5.2.0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
validateSingleCommit: true
8 changes: 4 additions & 4 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
documentation: ${{ steps.filter.outputs.documentation }}
cli: ${{ steps.filter.outputs.cli }}
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: dorny/paths-filter@v2
Expand Down Expand Up @@ -44,7 +44,7 @@ jobs:
if: ${{ needs.detect-changes.outputs.cli == 'true' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 0
- run: scripts/install_dependencies.bash
Expand All @@ -59,7 +59,7 @@ jobs:
if: ${{ needs.detect-changes.outputs.cli == 'true' }}
runs-on: macos-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 0
- run: scripts/install_dependencies.bash
Expand All @@ -75,7 +75,7 @@ jobs:
if: ${{ github.event_name == 'pull_request' && needs.detect-changes.outputs.documentation == 'true' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
# fetch all commits to get git log info for Vuepress
fetch-depth: 0
Expand Down
40 changes: 40 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,45 @@
# Changelog

## [0.13.1](https://github.com/asdf-vm/asdf/compare/v0.13.0...v0.13.1) (2023-09-12)


### Patches

* **fish:** use builtin realpath over system one ([#1637](https://github.com/asdf-vm/asdf/issues/1637)) ([5ac3032](https://github.com/asdf-vm/asdf/commit/5ac30328a7bbd1a8d974bb5fb1f14d8bd2d1e03f))

## [0.13.0](https://github.com/asdf-vm/asdf/compare/v0.12.0...v0.13.0) (2023-09-11)


### ⚠ BREAKING CHANGES

* `plugin list` exit code 0 when no plugins are installed ([#1597](https://github.com/asdf-vm/asdf/issues/1597))
* 0 exit code for success when adding an existing plugin ([#1598](https://github.com/asdf-vm/asdf/issues/1598))
* **fish:** don't resolve symlinks for ASDF_DIR ([#1583](https://github.com/asdf-vm/asdf/issues/1583))

### Features

* add plugin location when update the plugin ([#1602](https://github.com/asdf-vm/asdf/issues/1602)) ([36c7024](https://github.com/asdf-vm/asdf/commit/36c7024baa4b829b3629b4e0430157266d354158))


### Patches

* `plugin list` exit code 0 when no plugins are installed ([#1597](https://github.com/asdf-vm/asdf/issues/1597)) ([a029c00](https://github.com/asdf-vm/asdf/commit/a029c007503f2eec911a0c836e8622bb38c5e065))
* 0 exit code for success when adding an existing plugin ([#1598](https://github.com/asdf-vm/asdf/issues/1598)) ([4dd1904](https://github.com/asdf-vm/asdf/commit/4dd190466a9855dac300ce691e66a7629ef37b82))
* **fish:** don't resolve symlinks for ASDF_DIR ([#1583](https://github.com/asdf-vm/asdf/issues/1583)) ([d1a563d](https://github.com/asdf-vm/asdf/commit/d1a563dcc0107d5c631f73b114044898b5cadcf9))
* improve lint and test scripts ([#1607](https://github.com/asdf-vm/asdf/issues/1607)) ([b320803](https://github.com/asdf-vm/asdf/commit/b3208031204aabad6e85346155baacab16862da8))
* Make asdf.fish compatible with Fish 3.1.2 ([#1590](https://github.com/asdf-vm/asdf/issues/1590)) ([e83d71e](https://github.com/asdf-vm/asdf/commit/e83d71e43f525453994eb4cfda8ad66f8b914529))
* no longer write temporary files to home directory ([#1592](https://github.com/asdf-vm/asdf/issues/1592)) ([624604a](https://github.com/asdf-vm/asdf/commit/624604a8626dc6006d78121d4cf0f6c920449c56))
* nushell language syntax update ([#1624](https://github.com/asdf-vm/asdf/issues/1624)) ([0ddab5d](https://github.com/asdf-vm/asdf/commit/0ddab5dfaf28ad97c84a6aa56b08ccc212e07b4d))
* set default shell version values on POSIX entrypoint ([#1594](https://github.com/asdf-vm/asdf/issues/1594)) ([4d5f22d](https://github.com/asdf-vm/asdf/commit/4d5f22ddb89ce53e24b1ab1cbefce3be95238a19))
* warn when any ./lib/commands are marked as executable ([#1593](https://github.com/asdf-vm/asdf/issues/1593)) ([2043a09](https://github.com/asdf-vm/asdf/commit/2043a09574bdfdfcf2daf2fdb3bff2d9d2dad64e))


### Documentation

* `bin/latest-stable` empty query is set to default ([#1591](https://github.com/asdf-vm/asdf/issues/1591)) ([299dc97](https://github.com/asdf-vm/asdf/commit/299dc97a5b63d8afe1a0bba03e32dddfb7fb8e51))
* migrate to VitePress from VuePress ([#1578](https://github.com/asdf-vm/asdf/issues/1578)) ([5133819](https://github.com/asdf-vm/asdf/commit/5133819a77aaa393def347bfecb1c442ece4c7f8))
* upgrade deps & fix breaking changes ([446f8c5](https://github.com/asdf-vm/asdf/commit/446f8c5f947cc5f30f03403c2cfe4dec71b0a494))

## [0.12.0](https://github.com/asdf-vm/asdf/compare/v0.11.3...v0.12.0) (2023-06-09)


Expand Down
2 changes: 1 addition & 1 deletion SECURITY.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ not covered under this security policy.**
<!-- x-release-please-start-version -->

```
0.12.0
0.13.1
```

<!-- x-release-please-end -->
Expand Down
5 changes: 3 additions & 2 deletions asdf.fish
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
if test -z $ASDF_DIR
set ASDF_DIR (realpath --no-symlinks (dirname (status filename)))
set ASDF_DIR (builtin realpath --no-symlinks (dirname (status filename)))
end
set --export ASDF_DIR $ASDF_DIR

Expand All @@ -18,7 +18,8 @@ end
if not contains $_asdf_shims $fish_user_paths
set --global --prepend fish_user_paths $_asdf_shims
end
set --erase _asdf_bin _asdf_shims
set --erase _asdf_bin
set --erase _asdf_shims

# The asdf function is a wrapper so we can export variables
function asdf
Expand Down
7 changes: 3 additions & 4 deletions asdf.nu
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
def-env configure-asdf [] {

let-env ASDF_DIR = ( if ( $env | get --ignore-errors ASDF_DIR | is-empty ) { $env.ASDF_NU_DIR } else { $env.ASDF_DIR } )
$env.ASDF_DIR = ( if ( $env | get --ignore-errors ASDF_DIR | is-empty ) { $env.ASDF_NU_DIR } else { $env.ASDF_DIR } )

let shims_dir = ( if ( $env | get --ignore-errors ASDF_DATA_DIR | is-empty ) { $env.HOME | path join '.asdf' } else { $env.ASDF_DIR } | path join 'shims' )

let asdf_bin_dir = ( $env.ASDF_DIR | path join 'bin' )


let-env PATH = ( $env.PATH | split row (char esep) | where { |p| $p != $shims_dir } | prepend $shims_dir )
let-env PATH = ( $env.PATH | split row (char esep) | where { |p| $p != $asdf_bin_dir } | prepend $asdf_bin_dir )
$env.PATH = ( $env.PATH | split row (char esep) | where { |p| $p != $shims_dir } | prepend $shims_dir )
$env.PATH = ( $env.PATH | split row (char esep) | where { |p| $p != $asdf_bin_dir } | prepend $asdf_bin_dir )

}

Expand Down
10 changes: 5 additions & 5 deletions asdf.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
export ASDF_DIR="${ASDF_DIR:-}"

if [ -z "$ASDF_DIR" ]; then
if [ -n "$BASH_VERSION" ]; then
if [ -n "${BASH_VERSION:-}" ]; then
# Use BASH_SOURCE[0] to obtain the relative path to this source'd file. Since it's
# a relative path, 'cd' to its dirname and use '$PWD' to obtain the fullpath.
# Use 'builtin cd' to ensure user-defined 'cd()' functions aren't called.
Expand All @@ -28,14 +28,14 @@ if [ -z "$ASDF_DIR" ]; then
return 1
fi
unset -v _asdf_old_dir
elif [ -n "$ZSH_VERSION" ]; then
elif [ -n "${ZSH_VERSION:-}" ]; then
# Use '%x' to expand to path of current file. It must be prefixed
# with '(%):-', so it expands in non-prompt-string contexts.

# shellcheck disable=SC2296
ASDF_DIR=${(%):-%x}
ASDF_DIR=${ASDF_DIR%/*}
elif [ -n "$KSH_VERSION" ] && [ -z "$PATHSEP" ]; then
elif [ -n "${KSH_VERSION:-}" ] && [ -z "$PATHSEP" ]; then
# Only the original KornShell (kornshell.com) has a '.sh.file' variable with the path
# of the current file. To prevent errors with other variations, such as the MirBSD
# Korn shell (mksh), test for 'PATHSEP' which is _not_ set on the original Korn Shell.
Expand Down Expand Up @@ -65,7 +65,7 @@ if [ -n "${ASDF_FORCE_PREPEND+x}" ]; then
else
# If ASDF_FORCE_PREPEND is not set, then prepend by default on macOS
# to workaround `path_helper`.
if [ -n "$BASH_VERSION" ] || [ -n "$ZSH_VERSION" ]; then
if [ -n "${BASH_VERSION:-}" ] || [ -n "${ZSH_VERSION:-}" ]; then
# shellcheck disable=SC3028
case $OSTYPE in
darwin*) _asdf_should_prepend=yes ;;
Expand All @@ -85,7 +85,7 @@ fi
# If prepending is enabled, remove any existing instances of asdf from PATH so
# the prepending done after is always at the frontmost part of the PATH.
if [ "$_asdf_should_prepend" = 'yes' ]; then
if [ -n "$BASH_VERSION" ] || [ -n "$ZSH_VERSION" ]; then
if [ -n "${BASH_VERSION:-}" ] || [ -n "${ZSH_VERSION:-}" ]; then
# shellcheck disable=SC3060
case ":$PATH:" in
*":${_asdf_bin}:"*) PATH=${PATH//$_asdf_bin:/} ;;
Expand Down
12 changes: 12 additions & 0 deletions bin/asdf
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,18 @@ asdf_cmd() {
fi

if [ -x "$ASDF_CMD_FILE" ]; then
# When '$ASDF_CMD_FILE' is an executable, we are executing a command directly from a plugin.
# Example: https://github.com/asdf-community/asdf-nim/blob/397c14a7f04ad5b91963814afc2e9cc92366e1c5/lib/commands/command-install-deps.bash
# In those cases, the path to that command is always an absolute path. However, this codepath can also be activated if a user accidentally
# marks files in ./lib/commands/* as executable. This code detects when that happens and prints a useful warning message.
if [[ "$ASDF_CMD_FILE" == ./lib/commands/* ]]; then
printf '%s\n' "----------"
printf '%s\n' "asdf: Warning: You are executing an asdf command from \$ASDF_DIR, but we detected that some files have been"
printf '%s\n' " erroneously marked as executable. All files under '$ASDF_DIR/lib/commands' must NOT be marked"
printf '%s\n' " as executable. Otherwise, asdf will not be able to source its core files"
printf '%s\n' "----------"
fi >&2

exec "$ASDF_CMD_FILE" "${@:${args_offset}}"
elif [ -f "$ASDF_CMD_FILE" ]; then
set -- "${@:${args_offset}}"
Expand Down
16 changes: 5 additions & 11 deletions docs/.vitepress/theme/custom.css
Original file line number Diff line number Diff line change
@@ -1,13 +1,7 @@
:root {
--vp-c-brand: #b744b8;
--vp-c-brand-light: #a379c9;
--vp-c-brand-lighter: #a379c9; /* TODO: change this colour to be lighter */
--vp-c-brand-dark: #a379c9;
--vp-c-brand-darker: #a379c9; /* TODO: change this colour to be lighter */
/* tip container */
/* TODO: change these css vars to be correct */
--vp-c-tip: #0070f3;
--vp-c-tip-bg: #e3eeff;
--vp-c-tip-title: #004bad;
--vp-c-tip-text: #002974;
--vp-c-brand-1: #b744b8;
--vp-c-brand-2: #a379c9;
/* TODO: make brand-2 and brand-3 different & set brand-soft */
--vp-c-brand-3: #a379c9;
/* --vp-c-brand-soft: #fae3ff; */
}
8 changes: 4 additions & 4 deletions docs/guide/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ asdf primarily requires `git` & `curl`. Here is a _non-exhaustive_ list of comma


```shell
git clone https://github.com/asdf-vm/asdf.git ~/.asdf --branch v0.12.0
git clone https://github.com/asdf-vm/asdf.git ~/.asdf --branch v0.13.1

```

Expand Down Expand Up @@ -300,7 +300,7 @@ Add the following to `~/.config/powershell/profile.ps1`:
Add `asdf.nu` to your `~/.config/nushell/config.nu` with:

```shell
"\nlet-env ASDF_NU_DIR = ($env.HOME | path join '.asdf')\n source " + ($env.HOME | path join '.asdf/asdf.nu') | save --append $nu.config-path
"\n$env.ASDF_NU_DIR = ($env.HOME | path join '.asdf')\n source " + ($env.HOME | path join '.asdf/asdf.nu') | save --append $nu.config-path
```

Completions are automatically configured
Expand All @@ -311,7 +311,7 @@ Completions are automatically configured
Add `asdf.nu` to your `~/.config/nushell/config.nu` with:

```shell
"\nlet-env ASDF_NU_DIR = (brew --prefix asdf | str trim | into string | path join 'libexec')\n source " + (brew --prefix asdf | into string | path join 'libexec/asdf.nu') | save --append $nu.config-path
"\n$env.ASDF_NU_DIR = (brew --prefix asdf | str trim | into string | path join 'libexec')\n source " + (brew --prefix asdf | into string | path join 'libexec/asdf.nu') | save --append $nu.config-path
```

Completions are automatically configured
Expand All @@ -322,7 +322,7 @@ Completions are automatically configured
Add `asdf.nu` to your `~/.config/nushell/config.nu` with:

```shell
"\nlet-env ASDF_NU_DIR = '/opt/asdf-vm/'\n source /opt/asdf-vm/asdf.nu" | save --append $nu.config-path
"\n$env.ASDF_NU_DIR = '/opt/asdf-vm/'\n source /opt/asdf-vm/asdf.nu" | save --append $nu.config-path
```

Completions are automatically configured.
Expand Down
Loading

0 comments on commit 498cce2

Please sign in to comment.