Commit Graph

148 Commits

Author SHA1 Message Date
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
fj0r
f0dac68236
git-v2: fix ga (#744)
Co-authored-by: nash <nash@iffy.me>
2024-01-24 08:37:23 -06:00
fj0r
f75db6dc5f
docker.nu : fix container-log and container-attach, add registry (#742)
- fix container-log 
- container-attach allow passing flag
- add `registry delete`

---------

Co-authored-by: nash <nash@iffy.me>
2024-01-23 09:17:22 -06:00
fj0r
e5176370f6
fix docker.nu and kubernetes.nu (#739)
updates using the spread operator

Co-authored-by: nash <nash@iffy.me>
2024-01-17 09:09:21 -06:00
fj0r
32d074eb04
use fill -c instead of str repeat (#740)
Sorry, I forgot to use `fill -c` and implemented `str repeat` with
similar function. Now change it back
Added a `log` helper function to avoid the frequent need to adjust the
output format
The original `lg` with a similar name was changed to `show`, but it is
basically only used for internal debugging.
I'm not sure if these should be merged, feel free to do whatever you
want

Co-authored-by: nash <nash@iffy.me>
2024-01-17 09:08:34 -06:00
fj0r
551b1816db
git-v2: imporve message of gp (#738)
Co-authored-by: nash <nash@iffy.me>
2024-01-17 08:37:13 -06:00
fj0r
30d386e363
upgrade to 0.89 (#729)
Co-authored-by: nash <nash@iffy.me>
2024-01-10 06:40:24 -06:00
fj0r
0632778754
comma: upgrade template (#725)
- README.md: delete the content of template and replace it with a link
- comma_test: T/F execute a closure and return a true or false
- comma_tmpl: add example of building image

---------

Co-authored-by: nash <nash@iffy.me>
2024-01-05 06:05:07 -06:00
fj0r
0d55be71ea
kubernetes to docker-compose (#726)
- kubernetes to docker-compose
- rearrange helm related commands

Co-authored-by: nash <nash@iffy.me>
2024-01-04 08:14:53 -06:00
Bob Hyman
cc4e573a24
Show activated python VE at beginning of prompt. (#722)
By default, the script that activates a python virtual environment for
nushell blindly prepends the virtual environment name to the existing
prompt, which causes the full-line prompt to wrap.
This change shows the virtual environment name properly positioned in
the prompt line.

To activate a python virtual environment with a pretty prompt:
```nu
---------------------------------------------------------- ~ ------------------------------------------------------- |V|
> $env.VIRTUAL_ENV_DISABLE_PROMPT = true; overlay use ve/mp2/bin/activate.nu
(mp2) ------------------------------------ ~/src/rust/nushell_worktrees/main ------------------------- [main ≡] --- |.V|
> 
```
(the unobvious environment prefix is the subject of
nushell/nushell#11469)
2024-01-02 10:53:37 -06:00
fj0r
9b7c1772e2
comma test runner (#715)
- Stabilized the format
- Test suit runner
- Support batch mode
- Watch supports postpone
- `settings.theme`
- docker.nu Simplify process-list logic

---------

Co-authored-by: nash <nash@iffy.me>
2023-12-29 09:49:28 -06:00