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
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Prev Previous commit
Next Next commit
port lint_directories.nu
  • Loading branch information
39555 committed May 12, 2024
commit c57acfa91c4aae065c17c694428634e9b90627a0
14 changes: 7 additions & 7 deletions modules/lint_directories.nu
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@
# - 1.0.1 is a valid directory name.
# - yeah_whatever_linter is not a valid directory name.
def ls-incorrect-dirs [] {
ls | where type == 'Dir' and name != 'scripts'| match -v name '(\d+\.){2,}\d$'
ls | where type == dir and name != 'scripts' | find --invert --regex '(\d+\.){2,}\d$' --columns [name]
}
let incorrect_count = (ls-incorrect-dirs | length);
if $incorrect_count > 0 {
# echo `The following directories are named incorrectly: {{(char newline)}}`
$"The following directories are named incorrectly: (char newline)"
ls-incorrect-dirs
exit 1
} {
exit 0
print $"The following directories are named incorrectly: (char newline)"
print (ls-incorrect-dirs)
exit 1

} else {
exit 0
}