1
Fork 0
mirror of https://github.com/RGBCube/nu_scripts synced 2025-08-02 07:07:46 +00:00

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`
This commit is contained in:
Igor 2024-05-13 17:54:10 +04:00 committed by GitHub
parent bb814f1173
commit a0e69735ed
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 11 additions and 154 deletions

View file

@ -0,0 +1,16 @@
# List any directory that does not follow a SemVer naming pattern
# For example
# - 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' | find --invert --regex '(\d+\.){2,}\d$' --columns [name]
}
let incorrect_count = (ls-incorrect-dirs | length);
if $incorrect_count > 0 {
print $"The following directories are named incorrectly: (char newline)"
print (ls-incorrect-dirs)
exit 1
} else {
exit 0
}