Skip to content

Port before_v0.60/coloring folder (issue #221) - #836

Merged
fdncred merged 18 commits into
nushell:mainfrom
39555:port-before_v0.60/coloring
May 13, 2024
Merged

fdncred merged 18 commits into
nushell:mainfrom
39555:port-before_v0.60/coloring

Conversation

@39555

@39555 39555 commented May 12, 2024

Copy link
Copy Markdown

This PR is part of porting all old scripts #221 and ports coloring folder

@fdncred

fdncred commented May 13, 2024

Copy link
Copy Markdown
Contributor

looks like there are some conflicts here

Igor added 18 commits May 13, 2024 17:20
This script is already ported to `modules/coloring/24bit-1.nu`
This script is already ported to `modules/coloring/256_color_testpattern.nu`
- `str lpad` -> `fill -a l`
- `if {}{}` -> `if {} else {}`
- `str collect` -> `str join`
- explicit `print`
- `str collect` -> `str join`
- remove the commented old script for 0.31
- pipeline for -> `each`
- escape `\`
- remove the version comment
- `str collect` -> `str join`
- remove `autoview`
- math eval % to `mod`
- `str collect` -> `str join`
- `if {} {}` -> `if {} else {}`
- merge `nu_index_fg.nu` and `nu_index_fg2.nu` this is the same script
- math eval % to `mod`
- `str lpad -l` to `fill -a l -w`
- `str collect` -> `str join`
- `if {} {}` -> `if {} else {}`
- uncomment one-liner, make a function
- `str collect` -> `str join`
- `str lpad -l` -> `fill -a l -w`
- `if {...} {<empty>}` -> `if {}`
- explicit print
- `str collect` -> `str join`
- explicit print
- `str lpad -l` -> `fill -a l -w`
- `str collect` -> `str join`
- remove autoview
- `echo 40..47 100..107 49` -> `[40..47 100..107 49] | each { flatten } | flatten`
I've pasted them inside nu scripts
@39555
39555 force-pushed the port-before_v0.60/coloring branch from ef22f0f to 917abad Compare May 13, 2024 13:21
@39555

39555 commented May 13, 2024 •

Copy link
Copy Markdown
Author

I updated my fork and rebased my branch. Conflicts were due deletion *sh *.ps1 *.py files in the coloring module

@fdncred

fdncred commented May 13, 2024

Copy link
Copy Markdown
Contributor

Oh, I had those files there for a reason when I wrote them. It's good to see what the bash/pwsh/python equivalent is when porting a script. Maybe we should add them back.

@39555

39555 commented May 13, 2024

Copy link
Copy Markdown
Author

Oh, I had those files there for a reason when I wrote them. It's good to see what the bash/pwsh/python equivalent is when porting a script. Maybe we should add them back.

I put them in comments in nu files. Some nu scripts has already contain bash equivalents in comments so I decided it is convenient. If they should be separated files, I can revert it and just move to new location

@fdncred

fdncred commented May 13, 2024

Copy link
Copy Markdown
Contributor

oh, I'm fine with comments. Thanks!

@fdncred
fdncred merged commit bb814f1 into nushell:main May 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants