Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Port root before_v0.60/*.nu scripts (issue #221) #837

Merged
merged 7 commits into from
May 13, 2024

Conversation

39555
Copy link
Contributor

@39555 39555 commented May 12, 2024

This PR is part of porting all old scripts #221 and ports all root before_v0.60/*.nu scripts to modules/*.nu

39555 added 6 commits May 12, 2024 23:28
`into bits` `into int` already in the core
This script is already ported to `sourced/fehbg.nu`
just `update {|row| ...}`
- `if {} {}` -> `if {} else {}`
- `str find-replace` -> `str replace`
$cat
}
} | where Category !~ ".git" | select Category File | sort-by Category)

# Let's fix the file now
let nu_table = ($nu_table | update File { |it|
let file_path = ($it.File | into string | str find-replace '\\' '/')
let file_path = ($it.File | into string | str replace '\\' '/')
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm thinking this should probably be str replace '\\' '/' --all, otherwise it just replaces the first one I think.

- add `--all` to replace all occcurencies
- `\\` -> '\'. No need to escape backslash in single qoutes
@fdncred fdncred merged commit a0e6973 into nushell:main May 13, 2024
1 check failed
@fdncred
Copy link
Collaborator

fdncred commented May 13, 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.

None yet

2 participants