Skip to content

Comments

Port before_v0.60/data_extraction before_v0.60/examples before_v0.60/duplicates#847

Merged
fdncred merged 9 commits intonushell:mainfrom
39555:port-before_v0.60/data-extraction-examples-duplicates
May 26, 2024
Merged

Port before_v0.60/data_extraction before_v0.60/examples before_v0.60/duplicates#847
fdncred merged 9 commits intonushell:mainfrom
39555:port-before_v0.60/data-extraction-examples-duplicates

Conversation

@39555
Copy link
Contributor

@39555 39555 commented May 25, 2024

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

39555 added 7 commits May 13, 2024 00:00
This script is already ported to `modules/data_extraction/ultimate_extractor.nu`
- `empty?` -> `is-empty`
- `pivot` -> `transpose`
- `Column1` -> `column1`
- implicit `it` -> `in`
- add `print`
- add `source duplicates.nu`
- remove `echo`
- replace all '-' with '_'
- `keep until` -> `take until`
- explicit `$it`
- `str collect` -> `str join`
- `str find-replace` -> `str replace`
- "\[ \]" -> to the raw '\[ \]'
- `if {} {}` -> `if {} else {}`
- explicit print
- embed the `core-team` table, remove `assets/core_team.nu`
- embed the `date local` function from `language/std/date`
- explicit print
- `str collect` -> `str join`
- `$block` -> `$closure`
- `date format` -> `format date`
@fdncred
Copy link
Contributor

fdncred commented May 26, 2024

modules need to have exported custom commands, sourced do not.

39555 added 2 commits May 26, 2024 18:38
- rename `duplicates.nu` into `mod.nu`
- add export keywords
@39555
Copy link
Contributor Author

39555 commented May 26, 2024

duplicates is now a module with mod.nu and exported functions. examples are now in sourced/ because they are just plain scripts

@fdncred fdncred merged commit 275a0f8 into nushell:main May 26, 2024
@fdncred
Copy link
Contributor

fdncred commented May 26, 2024

thanks

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