This PR is part of porting all old scripts #221 and includes the
`virtual_environments` module
## 5 files changed
- `conda.nu`: removed, already in
`modules/virtual_enviromnents/conda/nu_conda.nu`
- `conda_deactivate.nu`: also removed, has already been merged with
`nu_conda.nu`
- `README.nu`: removed, similar info in
`modules/virtual_enviromnents/README.md`
- `venv.nu`: ported to `modules/virtual_enviromnents/venv/venv.nu`
- `venv_deactivate.nu`: ported to
`modules/virtual_enviromnents/venv/venv_deactivate.nu`
This PR is part of porting all old scripts #221 and includes a set of
modules:
- `data_extraction`
- `examples`
- `duplicates`
## 7 changed files:
### `data_extraction`
- `data_extraction/ultimate_extractor.nu`: removed. Has already been
ported to `modules/data_extraction/ultimate_extractor.nu`
### `duplicates`
- `duplicates/duplicates.nu` -> `modules/duplicates/duplicates.nu`
- `duplicates/example.nu` -> `modules/duplicates/example.nu`
- `duplicates/README.md` -> `modules/duplicates/README.md`: unchanged
### `examples`
- `examples/netstat.nu` -> `modules/examples/netstat.nu`
- `examples/date_in_local_timezones.nu` ->
`modules/examples/date_in_local_timezones.nu`
- `befove_v0.60/assets/core_team.nu`: removed. This table has been
embedded into `date_in_local_timezones.nu`
This PR is part of porting all old scripts #221 and includes a set of
modules:
- `config_management`
- `language`
- `tests`
- `prompt`
## 12 files changed
### `config_management`
This module was removed, because it was related to the old `config.toml`
format
1. `README.md`: removed
2. `config.toml`: removed
3. `startup.nu`: removed
### `language`
4. `playground.nu` : unchanged because this is just `source ...`
5. `std.nu` : unchanged because this is just `source ...`
6. `playground/lib.nu` -> `playground/mod.nu` and all commands have been
exported
7. `std/date.nu` + `export` keyword
### `tests`
This module contained only the usage of `language` module, so I merged
it with `language`
8. `tests/language/std/date.nu` -> `modules/language/tests/date.nu`
9. `main.nu`: removed because it was just `source date.nu`
### `prompt`
10. `git_status_prompt.nu` -> `modules/git_status_prompt.nu` + `export`
keyword
11. `left_and_right_prompt.nu` -> `modules/left_and_right_prompt.nu` +
`export` keyword
12. `README.md` : has been removed as a duplicate of
`modules/prompt/README.md`
This PR is part of porting all old scripts #221 and includes a set of
modules:
- fuzzy -> `modules/fuzzy/fuzzy_command_search.nu`
- ls-mods -> `modules/ls-mods`: `ls-less.nu`, `ls-wide.nu` and
`ls-wide-with-color.nu`
- nu_101 -> `modules/nu_101`: `nothing.nu` and `inner_outer_loop.nu`
Edit: `fuzzy` and `nu_101` have been moved to `sourced`
This PR is part of porting all old scripts #221 and includes the
`stdlib_candidate` scripts
## 7 changed files
- `flatter.nu`
- `get-column.nu`
- `get-row.nu`
- `get-latest-release-linux.nu`
- `logging.nu`
- `nu_style.nu`
- `print.nu`
This PR is part of porting all old scripts #221 and includes only
removing already ported modules:
- `progress_bar` -> `sourced/progress_bar`
- `weather` -> `modules/weather`
- `webscrapping` -> `sourced/webscrapping`
1. double pathsep when displaying PWD
2. error 'not a git repo' when PWD outside a repo (`do --ignore-error
{}` no longer eats the stderr text?)
3. improve display when terminal quite narrow (not a regression, just an
improvement)
4. reduce overhead for padding
Allow custom-completions/yarn to complete scripts and bins by explicitly
listing existing commands and scripts & bins that loads from the current
path.
This PR is part of porting all old scripts #221 and ports `make_release`
folder
## Summary
### make_release/this_week_in_nu_weekly.nu
This script has already been ported and has received some updates: #433.
So I just removed it
```yaml
from: before_v0.60/make_release/this_week_in_nu_weekly.nu
to: make_release/this_week_in_nu_weekly.nu
functions:
do-work: make_release/this_week_in_nu_weekly.nu:1:query-week-span
```
### make_release/this_week_in_nu_release.nu
I have ported this, but I'm not sure if we need it because it has
strange name and we have `prs.nu` and `make_release/release-note/`
```yaml
from: before_v0.60/make_release/this_week_in_nu_release.nu
to: make_release/this_week_in_nu_release.nu
functions:
do-work: make_release/this_week_in_nu_release.nu:1:do-work
```
### make_release/nu_release.nu
This has already been ported to `make_release/nu_release.nu` and has
received new updates #828 so I just removed it
```yaml
from: before_v0.60/make_release/nu_release.nu
to: make_release/nu_release.nu
```
### make_release/gen-js-ext.nu
This has already been moved to `make_release/gen-js-ext.nu` and has
received new updates #621 but not completely ported so I have ported it
- pipeline `for` to `each`
- `$nu.scope.commands` to `scope commands`
- explicit `print`
```yaml
from: before_v0.60/make_release/gen-js-ext.nu
to: make_release/gen-js-ext.nu
functions:
gen_keywords: make_release/gen-js-ext.nu:1:gen_keywords
gen_sub_keywords: make_release/gen-js-ext.nu:20:gen_sub_keywords
```
### make_release/gen-ts-ext.nu
I have ported this script
```yaml
from: before_v0.60/make_release/gen-ts-ext.nu
to: make_release/gen-ts-ext.nu
functions:
gen-ts-cmds-begin: make_release/gen-ts-ext.nu:1:gen-ts-cmds-begin
gen-ts-cmds: make_release/gen-ts-ext.nu:18:gen-ts-cmds
gen-ts-subs: make_release/gen-ts-ext.nu:40:gen-ts-subs
```
This PR is part of porting all old scripts #221 and ports `fun` folder
<details><summary>Summary</summary>
### star.nu
```yaml
from: before_v0.60/fun/star.nu
to: modules/fun/star.nu
```
### spark.nu
The script has already been ported. I've removed old version.
```yaml
from: before_v0.60/fun/spark.nu
to: sourced/fun/spark.nu
functions:
spark: sourced/fun/spark.nu:1:spark
```
### life.nu
```yaml
from: before_v0.60/fun/life.nu
to: modules/fun/life.nu
```
### lisp_mode.nu
There is a problem with this module because `-` is not allowed in names
anymore, however `def "-"` is a valid syntax, but you will be unable to
call this function.
```yaml
from: before_v0.60/fun/lisp_mode.nu
to: sourced/fun/lisp_mode.nu
```
### nyancat.nu
I also fixed animation frames from https://github.com/klange/nyancat
```yaml
from: before_v0.60/fun/nyancat.nu
to: modules/fun/nyancat.nu
```
</details>
This PR is part of porting all old scripts #221 and ports
`cool_oneliners` folder
## Summary
### dict.nu
This script has already been ported to `sourced/cool_oneliners/dict.nu`
in
28c7e097db
```yaml
from: before_v0.60/cool_oneliners/dict.nu
to: sourced/cool-oneliners/dict.nu
functions:
dict: sourced/cool-oneliners/dict.nu:2:dict
```
### file_cat.nu
has already been ported to `sourced/cool_oneliners/file_cat.nu` in
c47ccd42b8
```yaml
from: before_v0.60/cool_oneliners/file_cat.nu
to: sourced/cool-oneliners/file_cat.nu
```
### filesize.nu
```yaml
from: before_v0.60/cool_oneliners/filesize.nu
to: sourced/cool-oneliners/filesize.nu
```
### js_map_to_markdown.nu
```yaml
from: before_v0.60/cool_oneliners/js_map_to_markdown.nu
to: sourced/cool-oneliners/js_map_to_markdown.nu
```
I created `sourced/cool-oneliners/assets/js_map.json` with the data for
this script as it was before
### cdpath-implementation.nu
```yaml
from: before_v0.60/cool_oneliners/cdpath-implementation.nu
to: sourced/cool-oneliners/cdpath-implementation.nu
functions:
c: sourced/cool-oneliners/cdpath-implementation.nu:18:c
```
### parse_aws_s3_ls.nu
I don't have aws so I just ported the syntax
```yaml
from: before_v0.60/cool_oneliners/parse_aws_s3_ls.nu
to: null
```
Edit: I considered not porting this script yet because I can't test it
for now
### npm_update_versions.nu
```yaml
from: before_v0.60/cool_oneliners/npm_update_versions.nu
to: sourced/cool-oneliners/npm_update_versions.nu
```
### xml_search_schema.nu
```yaml
from: before_v0.60/cool_oneliners/xml_search_schema.nu
to: sourced/cool-oneliners/xml_search_schema.nu
```
I used [typos](https://github.com/crate-ci/typos/).
I manually checked all the corrections and they seem safe to me.
There are still some left, but those in this PR are good
Here is a bunch of fixes I implemented to make Winget custom completion
script functional.
Namely,
- Made it compatible with the latest Nushell version
- Fixed parsing of Winget show command
- Added the missing command aliases
- Implemented a workaround for the in Winget itself when filtering for a
particular package source -
https://github.com/microsoft/winget-cli/issues/4236
What it says on the tin. This just updates the `bump-version.nu` script
to also edit the version in
the new nu_plugin_nu_example plugin, the same way it does for python
Implemented definitions for all composer 2.7 base commands with flags,
arguments, and descriptions. Also add completions when a set of values
is expected 🙂
I wasn't sure if this was on purpose or not but the conda environments
were simply "activate" and "deactivate" instead of "conda activate" and
"conda deactivate" as they would be normally in bash/zsh.
Due to the potential name conflicts I think it's better to leave these
as the more specific `conda activate` and let the user define an alias
in their file with `alias activate = conda activate`
Nushell 0.92 changed how external commands operate in pipelines:
https://www.nushell.sh/blog/2024-04-02-nushell_0_92_0.html
After updating to Nushell 0.92, panache-git would print errors when the
current working directory was not a Git repository: "fatal: not a git
repository (or any of the parent directories): .git"
This change properly handles stderr from Git commands according to
Nushell's updated external command behavior.
Also, Nushell 0.91 introduced "is-not-empty", so places in the code
where a string was checked for being not-empty or not-contains were
simplified a bit.
Finally, the main command in the module was renamed to "main" to make it
simpler to import and use in config.
I added the missing shims, alias, and help commands for the scoop
completer (#483)
I also updated the deprecated `rootPath` and `globalPath` config names
for the config command
the hook (did_you_mean.nu) had stopped working for me recently, I added
an if branch for Windows to use their `Path` env var (not `PATH`) and
only list files that match in the `PATHEXT` env var to resolve my issue
This adds a little command that allows opening .env files as records.
My implementation removes comments and works with both quoted and
unquoted .env files.
This PR adds two [`cargo hack`](https://github.com/taiki-e/cargo-hack)
commands to the release process to check for errors due to combination
of features. The first one will run `cargo check` on each crate multiple
times over, toggling different combinations of features each time. This
is to check for compilation errors regarding missing imports, etc. The
second command will run `cargo build` for each crate separately (with
default features) to check for build errors (from `build.rs` or
whatever).
Using the [error](https://github.com/nushell/nushell/pull/11786) from
the 0.90.0 publishing as a test, the first command does indeed find the
compilation error.
In the future, we should probably put these commands into a manually
triggered CI job so that they will be run on multiple platforms.
Also, this PR cleans up `nu_release.nu` a little bit.
See
https://github.com/nushell/nu_scripts/pull/771#issuecomment-2020331739
and following
As we don't have a path forward to make sure all files are fixed and
will be maintained. (and the file detection itself is reliable)
Disable the `main` branch (and nightly run) for now.
This will keep the CI for PRs so at least added scripts pass the current
nu version
[Generated diff](https://www.diffnow.com/report/xmq4f) for command
because move broke it.
- No `file` prefix similar to other [filesystem
commands](https://www.nushell.sh/commands/categories/filesystem.html)
- Input paths instead of directory param for filters or globbing
- Record closure param with original path (`$in` is still stem)
- `--verbose` table output
- `--no-exectute` for dry run with `--verbose`
- Shorthand flags
- Parallel renaming for large directories
- More tests
@amtoine Request feedback 🙏🏼 Happy to revise ot revert anything!
```console
❯ bulk-rename -h
Rename bulk input files in parallel using a closure.
The reason behind this command is quite simple:
- Sometimes one receives a bunch of files with integer ids: 1, 2, 3, ...
- These ids come rarely with padding... i.e. 1 instead of 001 when there are 3-digit ids
- This means that file with id 9 will be sorted way after file with id 1000
This command allows to do such a task!
Examples:
Rename `.mise.toml` files to `.mise.local.toml` recursively
> glob **/.mise.toml | bulk-rename { str append .local }
Rename files in `/foo` with a name that has an id to have 3 digits with 0-padding
> ls /foo | bulk-rename { |path|
if $path.input.type == file {
$path.stem | parse "some_format_{id}"
| get 0
| update id { fill --alignment r --character 0 --width 3 }
| $"some_format_($in.id)"
}
# else skip dirs
}
Usage:
> main {flags} <update_stem>
Flags:
-v, --verbose - Show which files were renamed, if any
-n, --no-execute - Do not make any changes; add --verbose to see what would be made
whitespace bug: nushell/nushell#12264
-h, --help - Display the help message for this command
Parameters:
update_stem <closure()>: The code to rename the file stem: receives the old stem as input and a record param with both `stem` and `input` keys
Input/output types:
╭───┬───────────┬─────────────────────────────────╮
│ # │ input │ output │
├───┼───────────┼─────────────────────────────────┤
│ 0 │ list<any> │ nothing │
│ 1 │ list<any> │ table<old: string, new: string> │
╰───┴───────────┴─────────────────────────────────╯
```
- new function `kube refine`
- define the required information in `$env.KUBERNETES_REFINE`, `kube
refine` will collect information according to its definition
- definitions in `status` and `cluster_status` are runtime information
and will not be collected. They are used in the `kg` command to display
status
- normalize the output of the `kg`, `kgp`, `kgs` command using `krefine`
- rename `kcconf` to `kccc` (kubectl change context clone)
- a new module, `refine.nu`, declaratively extracts data from complex
structures.
- `container-list` additionally displays the cmd field of the image
---------
Co-authored-by: nash <nash@iffy.me>