Kurochan
4d5f22ddb8
fix: set default shell version values on POSIX entrypoint ( #1594 )
...
Co-authored-by: James Hegedus <jthegedus@hey.com>
2023-09-11 00:42:55 +10:00
Edwin Kofler
5b7d0fea0a
fix: Introduce ASDF_FORCE_PREPEND
variable on POSIX entrypoint ( #1560 )
2023-06-08 20:31:07 -04:00
Edwin Kofler
6b2ebf575f
fix: Typo in POSIX entrypoint ( #1562 )
2023-05-28 23:06:23 +10:00
Edwin Kofler
00fee78423
fix!: Remove files containing only asdf
wrapper functions ( #1525 )
2023-04-01 03:22:24 +00:00
Edwin Kofler
b6d0ca28d5
fix!: do not remove items from PATH in POSIX entrypoint ( #1521 )
2023-03-28 06:42:55 +00:00
Edwin Kofler
3379af845e
fix!: rework POSIX entrypoint for greater shell support ( #1480 )
2023-03-21 05:06:57 +00:00
Joe Horsnell
b7dd291c98
fix: Prevent unbound variable error with nounset in asdf.sh ( #1158 )
...
`asdf` [v0.9.0][1] included a [bug fix][2] to not override an existing ASDF_DIR.
However, if `ASDF_DIR` is not set at all, then this causes an error when using bash `set -u`, or
`set -o nounset` - see [here][3] for additional info.
[1]: https://github.com/asdf-vm/asdf/releases/tag/v0.9.0
[2]: https://github.com/asdf-vm/asdf/pull/1008
[3]: https://mywiki.wooledge.org/BashFAQ/112
2022-01-19 17:00:53 -05:00
Max Strübing
ac2791e49f
fix: newline after error msg for ASDF_DIR ( #1113 )
...
Co-authored-by: James Hegedus <jthegedus@hey.com>
2021-12-06 21:22:30 +11:00
Elijah
cc7778a040
feat: Elvish Shell support ( #1066 )
2021-11-18 21:05:27 +11:00
Eric Nielsen
73efc9fa97
fix: don't override existing ASDF_DIR ( #1008 )
2021-11-03 09:47:43 +11:00
James Hegedus
3246c26d52
fix: remove automatic compinit ( #678 )
...
* fix: remove automatic compinit
Raised by concerns in https://github.com/asdf-vm/asdf/issues/674 about performance implications and unexpected intrusive behaviour
* docs: fix ZSH compinit recommendations
* docs: clarify zsh completions further
* docs: fpath steps and notes on framework plugins
* docs: be verbose in explanation
* fix: remove fpath & compinit calls
2020-03-20 07:37:25 +11:00
James Hegedus
367eaa6ec9
edit fpath as was removed in asdf-vm PR #71
2020-02-19 16:08:36 -05:00
Paul
18b07ecaa6
Default ZSH_VERSION to empty string. ( #656 )
...
This avoids borking when a user has `set -u` (a.k.a. the `nounset`
option) enabled.
2020-02-14 16:50:11 +11:00
Pablo Lalloni
5bad5f4214
Remove shebang lines of sourced scripts
2019-12-31 09:48:56 -03:00
Victor Hugo Borja
e968fe6142
Subcommand-aware command line interface.
2019-11-27 12:17:17 -06:00
Daniel Perez
6523971b40
Check for bash before mksh
2019-03-31 20:44:49 +01:00
Daniel Perez
1d43a052fe
Merge pull request #480 from jonmast/add-shell-command
...
Add "shell" subcommand for setting versions in shell session
2019-03-20 19:02:59 +00:00
fallwith
2743bcb7f7
asdf.sh: comments for script path determination
...
Update `asdf.sh` to explain that `$_`, `${BASH_SOURCE[0]}`, and `$0`
are used by Korn, Bash, and Zsh (and others) to obtain the path to the
script, and what those special variables mean.
2019-03-20 11:49:04 -07:00
Jonathan Mast
9116e8453d
Add "shell" subcommand for setting versions in shell session
...
Add a "shell" command similar to the existing "global" and "local"
commands, which sets the version in an environment variable instead of
writing it to a file. This was inspired by the similar functionality in
rbenv.
It works by adding a wrapper function for the asdf command. It forwards
to a "sh-shell" command that returns the exports as shell code which is
then evaled by the wrapper. This is a little gross, but we need to run
the code in the shell context in order to set variables.
Resolves #378
2019-03-09 13:19:33 -05:00
fallwith
f8d843926a
asdf.sh: support mksh
...
The mksh shell (and perhaps others too) will not be able to determine a
sourced script's path by looking at either `${BASH_SOURCE[0]}` or `$0`.
By capturing the value of `$_` as the very first thing the script does,
`asdf.sh` can use that as the input for `dirname` in order to determine
a value to use for `$ASDF_DIR`.
I have tested this change with mksh to confirm that it works, and have
also tested it with both bash and zsh to verify that neither of those
stop working.
This resolves the only compatibility issue I've ran into with asdf,
caused by mksh sourcing a script. All subsequent asdf usage involves an
asdf executable doing the sourcing, so it's bash to bash at that point.
2019-02-20 16:42:45 -08:00
Trevor Brown
ec5a280beb
Remove unused asdf shims directory
2018-11-27 10:18:05 -05:00
Jose Luis Salas
0a9cd676f4
Fix user shims stored now in ASDF_DATA_DIR
2018-09-24 17:47:49 +02:00
Jose Luis Salas
d1782f456e
Retrieve asdf_data_dir from environment variable
2018-09-16 18:39:21 +02:00
Jose Luis Salas
c86707c55f
Add config option to install plugins in $HOME/.asdf
2018-08-11 15:37:56 +02:00
Trevor Brown
a8ee53f5ad
Disable shellcheck warning for echo statement.
2018-07-14 20:14:02 -04:00
Trevor Brown
bd8f7d9139
Print helpful error message when $ASDF_DIR is not a directory.
2018-07-14 20:01:09 -04:00
Trevor Brown
6d63496528
Switch from return
to exit 1
when ASDF_DIR is not a dir.
2018-07-14 09:47:33 -04:00
rafaelliu
fb4fc79be7
Adding back check if directory exists
2018-06-06 19:06:13 -07:00
rafaelliu
ae31774c69
Fixes #333 , there was a unnecessary cd issued (typo?) within a $ subshell on asdf.sh
2018-06-06 18:37:57 -07:00
James Hegedus
28cfda2179
add colon between asdf segment and PATH
2018-03-09 01:02:08 +11:00
James Hegedus
d3895f593c
match against whole PATH segments
...
string replacement still doesn't match against asdf segments when last in PATH
2018-03-09 01:01:09 +11:00
James Hegedus
f8c9e97900
revert use of colons to normalize PATH
...
* as per suggestion from here - https://github.com/asdf-vm/asdf/pull/303#issuecomment-371231967
* need to work on new PR with tests to address newly raised edge cases with PATH manipulation
2018-03-09 00:52:08 +11:00
James Hegedus
b0342d2f78
remove unnecessary colon
2018-03-07 17:06:34 +11:00
James Hegedus
c112fbf296
use variable in all places
2018-03-06 21:53:39 +11:00
James Hegedus
99110ce8d3
add or move asdf to front of PATH
2018-03-06 21:37:44 +11:00
jthegedus
e2a98e1345
add to PATH once. Fixes #261
2018-01-14 00:42:55 +11:00
Robin Schneider
ae2c5b88a1
Properly address shellcheck warnings ignored in #156
2017-03-07 16:20:04 +01:00
Robin Schneider
809f32bb9f
export ASDF_DIR so that plugins can use it to refer to the ASDF DIR
...
Also fixed `shellcheck` warnings in the file.
2017-02-12 20:21:24 +01:00
Daniel Perez
1589a03678
Merge pull request #53 from ctreatma/feature/only_pwd
...
Fix #52 : Send any `cd` output to /dev/null
2016-07-02 13:56:41 +09:00
Charles Treatman
1d11a73600
Redirect all output to /dev/null, not just stdout
2016-07-01 19:40:05 -04:00
David Bernheisel
29807fd154
zsh: remove _asdf completion. #68
2016-06-29 16:06:33 -04:00
Teja Sophista V.R
a2844400f4
use bashcompinit instead of compinit for ZSH
2016-06-27 11:14:12 +07:00
Charles Treatman
5e9b1cca77
Fix #52 : Send any cd
output to /dev/null
...
Users of `zsh` can define hook functions that execute when
the current directory changes. If a user has their `zsh`
configured with a hook function that writes to stdout, the
`asdf` setup script will capture that output in addition to
the output of `pwd`, which causes a misconfiguration of the
`PATH` environment variable.
By redirecting the output, if any, of the `cd` command to
`/dev/null`, this ensures that the path to `bin` in `asdf`
is captured correctly regardless of `zsh` configuration.
2016-05-10 15:04:18 -04:00
Justin
7476c02f0a
Adds (very) basic zsh autocompletion
2015-12-05 11:14:37 +01:00
Akash Manohar J
32c5c1a858
Check if source or dot operator is used
2015-06-17 06:14:27 +05:30
Akash Manohar J
237a5ab59e
Fix #1 : Better to stick to a single common shell
...
Referred a couple other version managers. The advantage is not having to
maintain the scripts for other shells (bash comes by default everywhere
I've seen).
2015-05-19 10:44:10 +05:30
Akash Manohar J
e80ec0cfbf
Fix sourced usage
2015-05-14 12:21:01 +05:30
Akash Manohar J
f15a761c4a
init script
2015-05-10 22:18:03 +05:30
Akash Manohar J
0ff759a9be
Dir structure
2014-09-30 05:23:59 +05:30
Akash Manohar J
da8b5840be
Stubbed out functions
2014-09-29 22:21:09 +05:30