-
Notifications
You must be signed in to change notification settings - Fork 104
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
Do not truncate ".jl" from generated package directory #421
Do not truncate ".jl" from generated package directory #421
Conversation
Codecov Report
@@ Coverage Diff @@
## master #421 +/- ##
===========================================
- Coverage 93.58% 71.86% -21.73%
===========================================
Files 23 23
Lines 686 686
===========================================
- Hits 642 493 -149
- Misses 44 193 +149
... and 11 files with indirect coverage changes 📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks!
""" | ||
function pkg_name_from_pkg_dir(pkg_dir::AbstractString) | ||
pkg = basename(pkg_dir) | ||
return endswith(pkg, ".jl") ? pkg[1:end-3] : pkg |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we could use chopsuffix
(but idk what Julia version that was introduced in, so maybe we can't)
return endswith(pkg, ".jl") ? pkg[1:end-3] : pkg | |
return chopsuffix(pkg, ".jl") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TIL! Looks like it shows up in 1.8...
Fixes #353.
Probably non-breaking, as I don't see it explicitly documented anywhere that a ".jl" suffix would be removed when generating a package.
Updated approach respects user input:
Template("MyPkg.jl")
will create directory "MyPkg.jl", whileTemplate("MyPkg")
will generate directory "MyPkg". Contents of these two packages will be otherwise identical.