Commit Graph

158 Commits

Author SHA1 Message Date
Kuo-tung Kao
526c9525ea
fix ka command in kubernetes module (#884)
substring ..-1 not working. Use str trim to remove '-'
2024-06-24 07:00:35 -05:00
Bruce Weirdan
a992f5b4fa
Add jc wrapper (#883)
This PR adds `jc` wrapper, so that `jc` output is automatically parsed
into a nushell data structure and you don't have to use `| from json`
filter to parse it.

References: https://kellyjonbrazil.github.io/jc/#jc
2024-06-22 12:41:11 -05:00
Darren Schroeder
92db3a88eb
update vswhere location for nu_msvs (#882)
This PR makes the location of vswhere more programmatic by looking where
it's supposed to be located on the file system instead of relying on it
being in your path.
2024-06-18 09:19:02 -05:00
Darren Schroeder
ddbebf197d
add find_msvs custom command to the nu_msvs module (#881)
I changed `export-env {}` at the beginning to a custom command to avoid
having `export-env` run when loading the module
  because:
1. I couldn't use `nu_msvs activate` because it depends on env vars
being set that were hidden with `nu_msvs deactivate`
2. It seems that `export-env` executed at `use`, leaves `$env.FILE_PWD`
available in the environment which I think may be
     a bug. So, putting it in a custom command avoids that.
2024-06-18 08:09:04 -05:00
Ian Manske
92f20ff282
Rmove usage of deprecated str contains --not (#880)
Related: https://github.com/nushell/nushell/issues/13163
2024-06-16 17:30:53 -05:00
Darren Schroeder
9b08b15981
update nu_msvs module (#879)
This updates the nu_msvs module. There were several things that I didn't
think looked proper for Windows so I changed them an hopefully made this
module a tiny bit better.
2024-06-13 14:45:43 -05:00
neur1n
d95857c119
resolve several issues in nu_conda and nu_msvs (#872)
1. fix: update `(sys).host` to `sys host` to work for 0.94.x
2. fix: handle incorrect behaviors when re-importing nu_conda or nu_msvs
3. doc: update minimum requirements of nushell in README.md
2024-06-07 07:36:00 -05:00
Igor
42732dad6a
Port before_v0.60/with_externals and cleanup (#852) 2024-05-26 16:34:36 -05:00
Igor
840d723d89
Port before v0.60/virtual_environments (#849)
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`
2024-05-26 12:38:00 -05:00
Igor
275a0f8f26
Port before_v0.60/data_extraction before_v0.60/examples before_v0.60/duplicates (#847)
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`
2024-05-26 12:37:29 -05:00
Igor
9d399d8902
Port before_v0.60/config_management before_v0.60/language before_v0.60/prompt before_v0.60/tests (#851)
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`
2024-05-26 12:37:01 -05:00
Igor
e8df70a406
Port before_v0.60/fuzzy, before_v0.60/ls-mods and before_v0.60/nu_101 (#845)
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`
2024-05-26 12:35:59 -05:00
Schweber
7a5424d7d0
modules/nix: init activation-script (#848) 2024-05-26 07:55:40 -05:00
Igor
15cb7179e2
Port before_v0.60/math, before_v0.60/parsing and before_v0.60/git (#844)
This PR is part of porting all old scripts #221 and includes a set of
small modules:
- `math`
- `parsing`
- `git`
2024-05-25 10:18:21 -05:00
Bob Hyman
429126f3d8
fix regressions noted in 0.93.1 from 0.83: (#843)
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
2024-05-25 08:28:42 -05:00
Wind
537d7fc4f4
Update conda.nu to use (sys host) rather than (sys).host (#839) 2024-05-22 06:35:50 -05:00
Igor
a0e69735ed
Port root before_v0.60/*.nu scripts (issue #221) (#837)
This PR is part of porting all old scripts #221 and ports all root
`before_v0.60/*.nu` scripts to `modules/*.nu`
2024-05-13 09:54:10 -04:00
Igor
bb814f1173
Port before_v0.60/coloring folder (issue #221) (#836)
This PR is part of porting all old scripts #221 and ports `coloring`
folder
2024-05-13 09:53:53 -04:00
Igor
2fe0756df9
Port before_v0.60/fun folder (issue #221) (#835)
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>
2024-05-13 07:55:11 -05:00
Maxim Uvarov
afde2592a6
use typos for corrections (#833)
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
2024-05-08 06:47:54 -05:00
Róbert Kalmár
76ab5b09b3
Remove deprecated --redirect-stdout in git branch cleanup (#827) 2024-04-29 06:22:31 -05:00
Rayan Amal
5782e2b5d2
Update README.md for background tasks (#826) 2024-04-28 16:07:57 -05:00
Jakub Žádník
1a4c6e9a6c
Revert "fix: prefix conda commands with conda" (#820)
Reverts nushell/nu_scripts#816

Fixes https://github.com/nushell/nu_scripts/issues/818
2024-04-17 19:13:23 +03:00
Miles Cranmer
0d665a71ec
fix: prefix conda commands with conda (#816)
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`
2024-04-12 06:26:51 -05:00
Edward DeVries
b1019dab18
panache-git: do not print stderr from Git commands (#813)
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.
2024-04-11 08:00:04 -05:00
Piepmatz
df90d65eec
Add from env (#808)
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.
2024-04-03 06:49:41 -05:00
fj0r
a715b74453
utils of history with sqlite (#779)
- backup
- restore
- timing
- top

---------

Co-authored-by: nash <nash@iffy.me>
2024-04-03 06:29:45 -05:00
fj0r
f39976902a
kube refine for backup (#793)
- 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>
2024-03-30 07:14:45 -05:00
Enzo Einhorn
41fe58ecee
Add Micromamba support (#800)
I initially tried to get Micromamba to work with Nushell by using the
script from [this
issue](https://github.com/nushell/nu_scripts/issues/578). But even after
fixing the syntax errors I couldn't activate any env.
With these modifications, Micromamba seems to be working fine.  
Please note that I'm far from a Nu expert so my code might not be very
idiomatic. If that is the case please tell me so and I'll be happy to do
the necessary changes.
2024-03-26 13:47:45 -05:00
Róbert Kalmár
3cee758551
Fix git branch cleanup for nushell version 0.91+ (#799) 2024-03-26 07:24:40 -05:00
Auca Coyan
13a73ab635
🐛 fix more parser errors (#783)
Hi! I reduced some of the errors in the daily CI. Still there are a few
of them, but at least is something

- Added the badge for the `daily.yml` (currently failing)
- removed old `docker` from v0.60
- removed old `git` from auto-generate completions
- removed `nethack` from auto-generate completions (wasn't very useful)
- removed `root` from auto-generate completions (wasn't very useful)
- removed `valgrind` from auto-generate completions (wasn't very useful)
- moved `less` from auto-generate to custom-completions.
- moved `mix` from auto-generate to custom-completions.
- moved `tar` from auto-generate to custom-completions.
- moved `tcpdump` from auto-generate to custom-completions.
- moved `virsh` from auto-generate to custom-completions.
- moved `zef` from auto-generate to custom-completions.
- fixed `base16.nu`
- fixed `from-cpuinfo.nu`
- fixed `from-dmicode.nu`
- fixed `to-number-format.nu`
- fixed `to-json-schema.nu`
2024-03-15 21:10:27 -05:00
fj0r
56fe4b94ff
standardized parameter naming for --help and fix regex capture (#786)
standardized parameter naming for `--help`
|old|new|
|-|-|
|img|image|
|ctn|container|
|p|file|
|ctx|context|
|ns|namespace|
|k|kind|
|r, i|resource|
|r|pod, service, deployment|
|res|kind|
|svc|service|
|d, dpl|deployment|

change `(?P<name>)` to `(?<name>)`

Co-authored-by: nash <nash@iffy.me>
2024-03-12 06:45:50 -05:00
neur1n
7fcbf543db
fix: update modules/virtual_environments/nu_msvs to work with nushell 0.91.0 (#784)
Fixed the `glob` related code as mentioned in title.
2024-03-10 21:25:44 -05:00
Auca Coyan
bc6273d971
🐛 fix a couple of parser errors (#782)
This is some legwork to the CI
- [x] fix one `get-row.nu` before 0.60, just because it was easy
- [x] `modules/formats/to-ini.nu`
- [x] `modules/git/git-v2.nu`
- [x] `modules/git/git.nu`
- [x] `modules/log/log.nu`
- [x] `modules/weather/weatherdark.nu`
- [x] `sourced/api_wrappers/worlframalpha.nu`
- [x] `sourced/cool-oneliners/pwd-short.nu`
- [x] `sourced/github/branch-protections/branch-protections.nu`
- [x] `sourced/gitlab/gitlab.nu`
- [x] `sourced/misc/nu_defs.nu`
- [x] `sourced/update-path.nu`
- [x] `sourced/webscraping/shell_starts.nu`
I moved some auto-generated commands:
- [x] `ack` 
- [x] `as`
- [x] `curl`
- [x] `fsarprc`
- [x] `fsarpri`
- [x] `godoc`
- [x] `mysql` 
- [x] and `xgettext` 
to custom, so we keep the modifications.
I had to comment some of the flags because the parser is not able to
parse some flags. Those are explained in comments
2024-03-10 14:05:01 -05:00
Auca Coyan
1ccc379f38
clone all script (#781)
Hi! I did a script to clone multiple repos of github in a single folder
I clone everything I intend to work when I reset my pc

Instructions incluided!
2024-03-10 07:11:37 -05:00
fj0r
6d98fee3ba
nu-complete docker containers: show all containers (#778)
- use `!` tag failed containers
- if there are duplicate names, the id comes first.

---------

Co-authored-by: nash <nash@iffy.me>
2024-03-08 06:10:46 -06:00
fj0r
43880c91ac
gb -d without arguments cleans branches (#777)
- `gb -d` cleans branches that meet the criteria, if no arguments
  - not current
  - merged
  - `gb -d --no-merged` includes no merged branches
- `gb` (no arguments) output `merged` instead of `no-merged`
- changed `$remote` of `gb` and `gp` to flag
- `remote_branches` return 'remote/branch'

Co-authored-by: nash <nash@iffy.me>
2024-03-06 21:10:45 -06:00
fj0r
0fd766871f
upgrade to 0.91 (#776)
update argx.nu, docker.nu, git-v2.nu, kubernetes.nu, ssh.nu, and nvim.nu
to support 0.91 syntax.

---------

Co-authored-by: nash <nash@iffy.me>
2024-03-06 06:08:26 -06:00
fj0r
a31696ea2a
Rename edit to nve to avoid potential conflicts (#768)
- rename `edit` to `nve` to avoid potential conflicts
- `e`, `c`, `v`, `x` export as alias
- nested nvim creates new buffer when no filename as args
- `cwdhist` use Alt+o as default

Co-authored-by: nash <nash@iffy.me>
2024-02-29 06:32:19 -06:00
fj0r
d177037ed2
merge nvdc into nvc (#764)
use a unified nvc to start the neovim client, and then have a flag --gui
to start the neovim gui program.
And collect some common GUI startup methods, detect which one exists and
start which one.

---------

Co-authored-by: nash <nash@iffy.me>
2024-02-25 08:42:14 -06:00
fj0r
da6fb3e800
add gig --empty-dir (#762)
upgrade nvdc for neovide

---------

Co-authored-by: nash <nash@iffy.me>
2024-02-25 07:46:28 -06:00
fj0r
144f3fefde
new cmd: container-log-trunc (#761)
clean container-log-namespace

Co-authored-by: nash <nash@iffy.me>
2024-02-20 06:33:12 -06:00
fj0r
e8f4d7462a
ksi: kubectl set image (#760)
Co-authored-by: nash <nash@iffy.me>
2024-02-20 06:32:46 -06:00
fj0r
7025edf6d6
fix container-create (#759)
Co-authored-by: nash <nash@iffy.me>
2024-02-17 09:02:24 -06:00
Róbert Kalmár
c8c29728d8
Add refs to git log output (#757)
This PR adds the list of references on a commit for the `gl` command
2024-02-07 09:11:55 -06:00
RGBCube
14e77c7ec8
background_task: Fix quoted commands and fix deprecation of implicit spreading and clarify docs (#752) 2024-02-05 06:28:48 -06:00
fj0r
302fd84fed
image-push supports renaming via -t (#750)
fix nu-complete of `docker registry show`

Co-authored-by: nash <nash@iffy.me>
2024-01-26 06:48:51 -06:00
Darren Schroeder
90b4229cc5
update jalon-git.nu to latest nushell syntax (#748)
This PR updates jalon-git.nu to the latest nushell syntax.
2024-01-25 11:47:11 -06:00
Darren Schroeder
2e3534d73d
remove comma.nu from repo (#747)
remove a personal project from our public repo.
2024-01-25 06:04:26 -06:00
fj0r
d9ba934d77
krd for kubectl redistribution deployment (#745)
Co-authored-by: nash <nash@iffy.me>
2024-01-25 05:56:20 -06:00